Class-member-function as TimerProc
Posted on 2000-04-13
I can't figure out how to set a timer so
that it calls a member-function of my
void CALLBACK EXPORT MyTimerProc(HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime);
SetTimer(...,MyTimerProc); // << error C2664
Currently all I can do is to use a
global, - non-class-member-function
but I need to have access to my class'es
variables when the timer-event occurs.
My problem is that when I try to use
a class-member-function in my SetTimer-
call then the compiler (VC 5.0) refuses
'SetTimer' : cannot convert parameter 4 from 'void (struct HWND__ *,unsigned int,unsigned int,unsigned long)' to 'void (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,unsigned long)'
Basically I want to stay "within" my
class with the TimerProc. Seemingly
I need a cast of some sort.
How can I do that ? Any help greatly appreciated ! Thanks a lot !