I am developing MFC Dialog based application in Visual Studio 2008. I want to use timer that start on start of the application and continue to run and calls a function that performs my task? How can I do this?
Thanks
Just use SetTimer
method, and pass two arguments: Timer ID (any number), and the timeout in milliseconds. Then write up OnTimer
implementation, and an entry ON_WM_TIMER
inside BEGIN_MESSAGE_MAP...END_MESSAGE_MAP
.
CWnd::SetTimer takes 3 parameters, but only 2 are required. Pass third argument as NULL.