C++ MFC

Moderators: Lundin
Number of threads: 3354
Number of posts: 9032

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
CWnd Timer Interval changing Posted by adamroper on 12 Feb 2013 at 6:42 AM
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
Thread Tree
adamroper CWnd Timer Interval changing on 12 Feb 2013 at 6:42 AM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.