Passing User Data with SetTimer
Posted
by
GJ
on Stack Overflow
See other posts from Stack Overflow
or by GJ
Published on 2011-01-07T11:50:02Z
Indexed on
2011/01/07
11:53 UTC
Read the original article
Hit count: 171
I am calling SetTimer in a function of a Class.
SetTimer(NULL, 0, 10000, (TIMERPROC) TimerCallBack);
Where TimerCallBack is: static VOID CALLBACK TimerCallBack(HWND, UINT, UINT, DWORD)
Now my need is to call one of the method of class which initiated timer, since TimerCallBack is static it has no access to the class object anymore.
I cant find any way to pass object pointer along with the SetTimer so that I can receive it back on Callback function.
Is there any other way to achieve this, if its not supported using SetTimer then which other way I can implement this.
© Stack Overflow or respective owner