Quantcast
Channel: Programmers Heaven Forums RSS Feed
Viewing all articles
Browse latest Browse all 2703

CWnd Timer Interval changing

$
0
0
Let me start by saying that I am an experienced C++ programmer, but my knowledge of MFC is limited. Best to get all of my cards on the table.

I have a rather large, rather 'evolved' user interface application that is exhibiting some oddness, so I have been asked to investigate, and one thing that I have noticed has completely stumped me.

The main window is a modal dialog that inherits from CDialog. There is a timer that are started at initialisation using the SetTimer() function, and it should trigger every 1000ms. I have put a TRACE() statement in the OnTimer() method and it is indeed invoked every 1000ms (plus a little bit). Excellent.

However at some point during operation 'all the evil' happens and after a time the interval between triggers from that timer increases to 3000ms.

Because of the state of the software I am currently unable to determine what 'all the evil' actually is, but to be honest that is irrelevant because the real question is why has the interval between triggers changed? There are no other references to SetTimer() in the class, and the one reference to KillTimer() is not called until the application exits - after five hours of running this thing I am confident in that. There is also nothing naughtily calling the OnTimer() function directly.

So my question is, what other things could cause the timer interval to change? I'm specifically wondering whether setting the Enable or Suspend state of the CDialog class can cause this change in the behaviour of CWnd timers.

Many thanks

Viewing all articles
Browse latest Browse all 2703

Trending Articles