timer does not start
-
Hi, in my MFC DLL, pMyDLLCWnd is pointer to a class driver from CWnd. When CDialog is linked to DLL, timer starts. When console is linked to DLL, same timer does not start. pMyDLLCWnd->Settimer(ID,t,NULL) DLL has wm_timer message handler.
Where do you create the window the pMyDLLCWnd points to: in a DLL or where?
-
Hi, in my MFC DLL, pMyDLLCWnd is pointer to a class driver from CWnd. When CDialog is linked to DLL, timer starts. When console is linked to DLL, same timer does not start. pMyDLLCWnd->Settimer(ID,t,NULL) DLL has wm_timer message handler.
Does your console application have message loop? If not, add it to handle Windows messages:
MSG msg;
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
} -
Where do you create the window the pMyDLLCWnd points to: in a DLL or where?
-
Hi, in my MFC DLL, pMyDLLCWnd is pointer to a class driver from CWnd. When CDialog is linked to DLL, timer starts. When console is linked to DLL, same timer does not start. pMyDLLCWnd->Settimer(ID,t,NULL) DLL has wm_timer message handler.
Could it be that you're using a timer that is based upon window messages, and there are no window messages in a console application?
The difficult we do right away... ...the impossible takes slightly longer.
-
Could it be that you're using a timer that is based upon window messages, and there are no window messages in a console application?
The difficult we do right away... ...the impossible takes slightly longer.
in DLL: pMyDLLCWnd is pointer to a DLL class derived from CWnd. pMyDLLCWnd->SetTimer(..) There are windows message handler WM_TIMER in DLL. In console there are no windows?. So, create a dummy window in console, pass its handle to the DLL?.Or, create a GetMessage while loop?. I have not tried this since I changed the design but like to try it.
-
in DLL: pMyDLLCWnd is pointer to a DLL class derived from CWnd. pMyDLLCWnd->SetTimer(..) There are windows message handler WM_TIMER in DLL. In console there are no windows?. So, create a dummy window in console, pass its handle to the DLL?.Or, create a GetMessage while loop?. I have not tried this since I changed the design but like to try it.
Can that message handler in the DLL be set up to call a function of yours?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
in DLL: pMyDLLCWnd is pointer to a DLL class derived from CWnd. pMyDLLCWnd->SetTimer(..) There are windows message handler WM_TIMER in DLL. In console there are no windows?. So, create a dummy window in console, pass its handle to the DLL?.Or, create a GetMessage while loop?. I have not tried this since I changed the design but like to try it.
I'm sorry, my answer was a quick guess. That's why I put a question mark after it. Truth is I'm not sure.
The difficult we do right away... ...the impossible takes slightly longer.