Question : CWnd::SetTimer() and KillTimer() help

I am trying to set timer using CWnd::SetTimer(). The compiler complains it should be 4 argument for SetTimer().  What file should I include so it will use the SetTimer() wrapper.
Following are the test code, will it work?  Any suggestion is appreciated.  
{
    // start the timer
    SetTimer(NULL, 1000, MyTimerCB);
    g_idEvent = WM_TIMER;
}
Sleep(10*1000);

if (g_idEvent != 0)
{
      KillTimer(NULL, g_idEvent);
      g_idEvent = 0;
}
….
void CALLBACK MyTimerCB(HWND hwnd, UINT uMsg,UINT_PTR idEvent, DWORD dwTime)
{
    KillTimer(hwnd, (int)idEvent);
    // send out a page
}

Answer : CWnd::SetTimer() and KillTimer() help

(1) the same applies as above - but you're already using the correct version. For others that addition might be an additional help to understand your code.

(2) Check the return value of 'KillTimer()' (http://msdn.microsoft.com/en-us/library/ms644903(VS.85).aspx) ;o)

(3) Yes, a timer callback does not need to have a window association as the docs on 'SetTimer()' (http://msdn.microsoft.com/en-us/library/ms644906(v=VS.85).aspx) state
Random Solutions  
 
programming4us programming4us