|
Thanks, That's just what I needed
|
|
|
|
|
Hi @ all
I hope that somebody can tell me how I can create a makefile from the command-line (not from VC++ with project/export_makefile) from .dsp or .dsw files.
Thanks a lot
|
|
|
|
|
Why don't use the VC++'s project/export_makefile? It's very convinent.
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Is it possible or isn't it possible? I found a perl-script programm on the internet that can convert a .dsp-file to a makefile, but I don't wanna start learning perl now just because of this one 'problem' (I'm getting strange error messages while compiling this script...).
So I just wanna get a makefile without always being forced to open VC++.
I wanna use this command in another makefile (with recursive use of make) to make sure to be always up to date with the dependencies.
|
|
|
|
|
Hi,
I am wondering if it's possible for my MDI Child window to have only max in min buttons, with no "X" for close?
Is the only was to achieve this with WM_NCPAINT?
Thanks
|
|
|
|
|
I have a weenie problem. As I have probably mentioned ( ad nauseum, I know ) I am doing a GUI library that is in Win32 and exposes itself through a Python console. I've created a dialog that shows a progress bar and allows you to set a range and step through it. You can also specify a timeout, so it shows itself after a particular time, the idea is unless it's a long time doing the function, you don't get the dialog. ( It was not my idea, I think it sucks ).
Anyhow, it works UNLESS you use it in a real world situation, i.e. where the processor is actually doing something during the timeout. I did it initially with a timer, but the timer would fire when the dialog went out of scope ( well, just before, but when the calculations stopped ). So I put the dialog in a thread. It wouldn't show at all. Now I put a seperate thread into the dialog class ( we have a class based on code stolen from Jeffrey Richter's book and we overload it by changing the Run method, so an instance of the class is a link to another thread ). I pass in the hWnd of the dialog, and in the thread I specify a timer and the call ShowWindow(m_hWnd, SW_SHOW). I have established the timer now fires perfectly, but as soon as I try to access the HWND, which is not being used for anything in the main thread, it hangs until the main thread finishes calculating, and the HWND is deleted.
I am at a loss - what could be happening here ? I tried a critical section around using the HWND, which just froze the program. Personally I don't see the point, but it's been requested and it's becoming a matter of pride. I admit to knowing little about threading (it's high on my list), so it's probably something really obvious. I *am* concerned about the possibility the HWND cannot be used in a different thread to the one that created it, but I don't think so because I believe such handles must surely be system wide, and I know the main thread is not doing anything with it.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Window created in one thread gets its messages from the thread message queue. If your dialog was born in thread A, it's goint to be fed with messages from the A message queue. Have no idea how exactly timers fit in this picture, but I feel that you should simply create the dialog in other thread.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I tend to agree, which is why I started with the instance of the thread class holding an instance my the dialog and creating it in the thread. The program froze, the GUI died and the window was never seen.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Are you sure the second thread is the GUI one? Maybe post some code.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I would have done so right away, but the code is at work. I admit to being a thread virgin - are you saying only one thread can be responsible for my GUI ? The main thread is doing all my GUI at the moment, except initially my dialog was happening in my second thread ( well, supposedly, nothing happened and the program froze ). The way our thread class works, I am certain that when it froze I was trying to run the dialog in the second thread. Now I am not, but either way when the second thread tries to access a HWND in any way, it freezes until the main thread kills the HWND.
I guess that's not much help, I should post some code tomorrow.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
are you saying only one thread can be responsible for my GUI ?
Absolutely not. But there are two flavours of threads - the worker threads without message queues, windows and such, and GUI threads with message queue. Probably you invoke your thread with AfxBeginThread, do you pass address of some function or RUNTIME_CLASS as 1st param?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
It's created with _beginthreadex, the app does not use MFC. I did not write the thread class, someone else stole my Richter book and wrote it.
He seemed to think when I asked that there was no difference between GUI and worker threads, which I thought was wrong but accepted as he has at least written this thing. I'll go to bed now and readu p on it, I think.
Thanks - I'll post some code tomorrow if I'm still stuck.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
So probably you'll have to add a message queue to the second thread.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
Okay, this is what I think you need to do. I don't have access to MSDN or anything as I'm not at home at the minute so if you need any more help just let me know.
I would suggest using an event (CEvent). You'd create an instance of a class which controls the progress dialog before the process begins. Then, the constructor would create a new thread. The first part of the thread function would create an event which has a timeout value as required. THen, it would wait on the event. When the even times out the dialog is created. You could have a flag which would cancel the process so that the dialog won't appear unless necessary.
Hope that helps!
--
Andrew.
|
|
|
|
|
Thanks for the advice, but unfortunately we are not using MFC.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
You don't need to be using MFC - Windows provides a series of functions which are wrapped by the CEvent class in MFC. Look up the following in MSDN for more info;
1. CreateEvent(...)
2. SetEvent(...)
3. ResetEvent(...)
4. WaitForSingleObject(...)
5. CloseHandle(...)
6. DuplicateHandle(...)
Hope this is useful - I think the idea should work anyway.
--
Andrew.
|
|
|
|
|
Cool - this looks VERY promising. I'll have a play at work this morning.
Thank you
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Thanks so much - I got this working like a treat and learned a bit of stuff in the process. Can't ask for more than that...
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Glad to be of help - cheers !
--
Andrew
|
|
|
|
|
I don't want to pass the CFtpConnection* pointer to a thread proc because that may be dangerous. Although I can get the handle of the FTP connection from the (HINTERNET) operation, I cannot construct a CFtpConnection object from the handle I've got because there's no such function. What should I do? Please help me out.
Thanks in advance.
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
I don't know anything about these classes, but I've decided to look into your problem as it appears to be more of a C++ issue than anything else.
The MFC header file for CFtpConnection shows that the class has a couple of constructors. The one you would probably use looks like this:
CFtpConnection(CInternetSession* pSession, HINTERNET hConnected, LPCTSTR pstrServer, DWORD dwContext);
Again, I don't know anything about these parameters but the second one looks like the one you'd be passing from the other thread. If this doesn't work I'd suggest you to derive a class from CFtpConnection. Since m_hConnection is protected in CInternetConnection, you'd have access to it in your derived class.
Good luck!
Alvaro
|
|
|
|
|
Thank you very much!
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Hi,
I'm trying to get my MDI app to use splitter windows:
My ChildFrame class is called CDesignFrame:
I removed the CView derived member and added a CSplitterWnd member instead.
I overrode the CDesignFrame::OnCreateClient and added this:
m_splitWnd.CreateStatic(this,
2,
1,
WS_CHILD | WS_VISIBLE,
AFX_IDW_PANE_FIRST);
SIZE sInitSize;
sInitSize.cx = lpcs->cx;
sInitSize.cy = lpcs->cy / 2;
m_splitWnd.CreateView(0,
0,
RUNTIME_CLASS(CDesignView),
sInitSize,
pContext);
m_splitWnd.CreateView(1,
0,
RUNTIME_CLASS(CDesignView),
sInitSize,
pContext);
CDesignView is simply the default AppWizard created view class. it doesn't do anything yet. All i did to it was declare and implement dyncreate on it.
Anyway. All compiles nicely, but when i run it, clicking file|new causes app to crash with an unhandled exception: Traceing through the app step by step shows the error comes from the CMDIFrameWnd::CreateNewChild function, when it calls pFrame->InitialUpdateFrame(NULL, TRUE);
The docs for InititalUpdateFrame say it'll update all views in the frame window. but there are none. but if i remove this function call, my frame isn't displayed.
I'm a bit lost. How should I do this?
Jon
|
|
|
|
|
|
I finally figured it out... Because I disabled the Doc/View architecture support in appwizard, My CView derived class was in fact CWnd derived.
Part of the InitialUpdateFrame function casts this CWnd Pointer to a CView, and then calls a member function which plainly doesnt exist. This causes the exception.
Nice to have it sorted.
Thanks again
|
|
|
|