I need to create Timer in my VC++ application , at where i need to set timer and on timeout of timer , i need to call one specific method…
i have seen msdn forums for that and done below code to do that
SetTimer(NULL,1,5*1000,TimerProc);
and my TimerProc method is as below
void CALLBACK TimerProc(HWND aHwnd, UINT aMessage, UINT_PTR aTimerId, DWORD aTime)
{
StopProceess();
}
i assume after 5 seconds the SetTimer should call TimerProc method , but it is never called. no idea what i am doing wrong in this. or plz suggest if there’s any alternative to do it.
Thanks.
Use waitable timer. Callback will be called after time set by 5-th parameter and repeat every 6-th parameter.
After time elapses, callback is called, executes some processing and sets event to allow exit
I do not check for errors, you should.