|
-
April 6th, 1999, 05:21 AM
#1
Is there a limit to how long WM_TIMER messages will fire for?
I am setting a timer using the window's SetTimer function and handling the message in the window's OnTimer handler. This seems to work fine for a while. However, I wish the timer to be active indefinately and after a few days it appears to no longer be signalling.
Is there a limit on how long the timer will keep firing?
-
April 6th, 1999, 05:32 AM
#2
Re: Is there a limit to how long WM_TIMER messages will fire for?
I believe timers use an unsigned int for the timeout value with a maximum value (in 32 bit systems) of 4294967295 ms. Assuming a value of zero gives you the maximum timeout (rather than an infinite timeout), this should run for about 49 days...
Dave
-
April 6th, 1999, 05:42 AM
#3
Re: Is there a limit to how long WM_TIMER messages will fire for?
If the timeout value is set to say 10 minutes, will this fire every ten minutes indefinitely though? Or is there a limit on how long the timer will keep firing?
-
April 6th, 1999, 05:53 AM
#4
Re: Is there a limit to how long WM_TIMER messages will fire for?
Oh, right, I see your point. Um, I don't know, the MSDN timer docs don't say. I would expect them to keep on going; we have a monitoring application using timers in VB which have kept going for weeks (or we'd get complaints!).
Timers are a limited resource, and if too many are used, I don't know what happens...
Dave
-
April 6th, 1999, 09:05 AM
#5
Re: Is there a limit to how long WM_TIMER messages will fire for?
If you want to be sure that your timer(s) are running till eternity, kill the
timer in the OnTimer() funktion and start the timer new.
That's what I do and it works well.
By looking at some samples it seems that even MS kills the timers.....
-
April 8th, 1999, 04:00 PM
#6
Re: Is there a limit to how long WM_TIMER messages will fire for?
It seems like you know what you are doing and I posted this elsewhere, but have gotten no responses:
Is there a way to determine which timers (by ID) are active without keeping track of them myself?
Thanks - H
-
Howard Uman - unHUman Software
http://www.unhuman.com
[email protected]
-
April 9th, 1999, 03:57 AM
#7
Re: Is there a limit to how long WM_TIMER messages will fire for?
> Is there a way to determine which timers (by ID) are active without keeping track of them myself?
Possibly, I don't know, but I'd track 'em myself if I were you.
Dave
-
April 9th, 1999, 05:50 AM
#8
Re: Is there a limit to how long WM_TIMER messages will fire for?
Using of SetTimer function sometimes is not very good idea as it just
posts message WM_TIMER to window queue and if there is already such a message in the
queue it doest posts it. So for long time intervals such a method doest work precisely.
Better use callback functions.
Anyway if u r using WM_TIMER make sure that
u r properly kill timers as windows have limited
number of timers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|