Archived

This topic is now archived and is closed to further replies.

SetTimer help

This topic is 5305 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know this is a bit noobie but what are the causes of a timer to return non zero and then not send any ticks, i thought it had something to do with my multithreaded rendering cycle but as i have removed it and still no ticks i cant see whats wrong. Facts: hwnd = handle is valid and not null id = (unsigned int)this, (timer class) delay = 100 function = points to a static member of the correct type settimer returns (unsigned int)this, which means sucessful This never give a tick (activates the function) after running for some time 2-3 min. Anyone with any ideas? Peter Beardsley

Share this post


Link to post
Share on other sites
Do you have a GetMessage/TranslateMessage/DispatchMessage loop and are you calling DefWindowProc in your window message handler?

If not, then your timer function won''t get called.

Share this post


Link to post
Share on other sites
Thought i would tell everyone incase anyone else didnt know,
If you dont ValidateRect(hWindow,NULL); a window then what happens the window is sent a stream of WM_PAINT messages correct, also WM_PAINT has heigher prio than WM_TIMER, (hint hint)

So in conclusion if your timer isnt working check to see that you havent forgotten to validate the rect to clear the back paint messages.

This is so no one else has to chase their tail for 3 hours.

Peter Bearsley

Share this post


Link to post
Share on other sites