At the end of your OnTimer call you should put something like
CDialog::OnTimer(nIDEvent);
And you should configure and start the timer using
m_nTimer = SetTimer (ID_TIMER_SECOND, 1000, 0);
And don't forget to kill the timer at the end...
Killtimer(m_nTimer);
Hope this helps... :thumbsup:
PS: I'm sure that the proposal from SAKryukov will be at least interesting so it would be nice for you to take a look at it... meanwhile, as he is suggesting to use threads to get the same behavior, and I don't know if you are comfortable using them or not or even if you can do it from your requirements, here you have a classic timer approach...
Two links that explain timers in a nice way:
The first one is from
Nemanja Trifunovic[
^] and is a
timers tutorial[
^].
The second one is from a commercial company that will try to sell
their product[
^]... Anyway, you can get some extra information and numbers on the different type of timers out there...