Timer in a non-CWnd class
-
I have created a generic class (not derived from CWnd). When I call one function in that class I like it to generate a call to another member function of the same class after about 3 seconds. Tips on how to accomplish that? Thanks / Anders _____________________________ ...and justice for all APe
-
I have created a generic class (not derived from CWnd). When I call one function in that class I like it to generate a call to another member function of the same class after about 3 seconds. Tips on how to accomplish that? Thanks / Anders _____________________________ ...and justice for all APe
VOID CALLBACK TimerProc( HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime ) { AfxMessageBox("TimerProc"); } bool CMyClass::Func() { SetTimer( NULL, 1, 500, TimerProc); … }
Got the following compiler error: error C2664: 'SetTimer' : cannot convert parameter 4 from 'void (struct HWND__ *,unsigned int,unsigned long,unsigned long)' to 'void (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,unsigned long)' _____________________________ ...and justice for all APe -
VOID CALLBACK TimerProc( HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime ) { AfxMessageBox("TimerProc"); } bool CMyClass::Func() { SetTimer( NULL, 1, 500, TimerProc); … }
Got the following compiler error: error C2664: 'SetTimer' : cannot convert parameter 4 from 'void (struct HWND__ *,unsigned int,unsigned long,unsigned long)' to 'void (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,unsigned long)' _____________________________ ...and justice for all APeHi, Within the Func() function use SetTimer as SetTimer( NULL, 1, 500, (TIMERPROC)TimerProc); This will work SUjan
-
Hi, Within the Func() function use SetTimer as SetTimer( NULL, 1, 500, (TIMERPROC)TimerProc); This will work SUjan
What should a simple coder like me do without you? Really Thanks! _____________________________ ...and justice for all APe