KillTimer 
Author Message
 KillTimer

I'm not quite clear reading the docs.

Is it necessary to kill a system timer created by an MFC app or is the timer
automatically terminated when the app quits?



Sun, 11 Sep 2005 19:13:35 GMT  
 KillTimer
I think this might answer your question.
Erik

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wces...


Quote:
> I'm not quite clear reading the docs.

> Is it necessary to kill a system timer created by an MFC app or is the
timer
> automatically terminated when the app quits?



Mon, 12 Sep 2005 09:14:42 GMT  
 KillTimer
Yes. Those are pretty much the same docs I said I wasn't clear on.


Quote:
> I think this might answer your question.
> Erik

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wces...
Quote:
> /_wcesdk_win32_settimer.asp



> > I'm not quite clear reading the docs.

> > Is it necessary to kill a system timer created by an MFC app or is the
> timer
> > automatically terminated when the app quits?



Mon, 12 Sep 2005 17:43:12 GMT  
 KillTimer
What I read is that you can kill your timer by calling KillTimer.
Is there a reason for you not to want to call KillTimer??
(If timer messages arrive to a still running application and your
callback function is gone you will get errors)

Erik


Quote:
> Yes. Those are pretty much the same docs I said I wasn't clear on.



> > I think this might answer your question.
> > Erik

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wces...
Quote:
> > /_wcesdk_win32_settimer.asp



> > > I'm not quite clear reading the docs.

> > > Is it necessary to kill a system timer created by an MFC app or is the
> > timer
> > > automatically terminated when the app quits?



Tue, 13 Sep 2005 09:44:36 GMT  
 KillTimer
I'm aware that I can kill the timer and I know how to kill the timer.

All I want to know is if it's necessary to manually kill timers in every app
that uses them.

I don't have a reason not to kill timers. I simply want to understand
Windows programming better.

In addition, I can think of a couple of reasons to have system timers die
automatically at program termination. First, one less call to make or forget
to make. Second, a slight savings in executable size. Third, you don't have
to worry about the limited number of timers being used up by apps that don't
manage them properly.


Quote:
> What I read is that you can kill your timer by calling KillTimer.
> Is there a reason for you not to want to call KillTimer??
> (If timer messages arrive to a still running application and your
> callback function is gone you will get errors)

> Erik



> > Yes. Those are pretty much the same docs I said I wasn't clear on.



> > > I think this might answer your question.
> > > Erik

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wces...

- Show quoted text -

Quote:
> > > /_wcesdk_win32_settimer.asp



> > > > I'm not quite clear reading the docs.

> > > > Is it necessary to kill a system timer created by an MFC app or is
the
> > > timer
> > > > automatically terminated when the app quits?



Wed, 14 Sep 2005 00:25:05 GMT  
 KillTimer
Here's a quote from Jeff Prosise Programming Windows 95 with MFC:

"If an application fails to free a timer before it terminates, Windows 95
will clean up after it when the process ends. Still, good form dictates that
every call to SetTimer should be paired with a call to KillTimer to ensure
that timer resources are properly deallocated"

Mike


Quote:
> I'm aware that I can kill the timer and I know how to kill the timer.

> All I want to know is if it's necessary to manually kill timers in every
app
> that uses them.

> I don't have a reason not to kill timers. I simply want to understand
> Windows programming better.

> In addition, I can think of a couple of reasons to have system timers die
> automatically at program termination. First, one less call to make or
forget
> to make. Second, a slight savings in executable size. Third, you don't
have
> to worry about the limited number of timers being used up by apps that
don't
> manage them properly.



> > What I read is that you can kill your timer by calling KillTimer.
> > Is there a reason for you not to want to call KillTimer??
> > (If timer messages arrive to a still running application and your
> > callback function is gone you will get errors)

> > Erik



> > > Yes. Those are pretty much the same docs I said I wasn't clear on.



> > > > I think this might answer your question.
> > > > Erik

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wces...

- Show quoted text -

Quote:
> > > > /_wcesdk_win32_settimer.asp



> > > > > I'm not quite clear reading the docs.

> > > > > Is it necessary to kill a system timer created by an MFC app or is
> the
> > > > timer
> > > > > automatically terminated when the app quits?



Wed, 14 Sep 2005 00:32:39 GMT  
 KillTimer
Thanks for the info Mike.


Quote:
> Here's a quote from Jeff Prosise Programming Windows 95 with MFC:

> "If an application fails to free a timer before it terminates, Windows 95
> will clean up after it when the process ends. Still, good form dictates
that
> every call to SetTimer should be paired with a call to KillTimer to ensure
> that timer resources are properly deallocated"

> Mike



> > I'm aware that I can kill the timer and I know how to kill the timer.

> > All I want to know is if it's necessary to manually kill timers in every
> app
> > that uses them.

> > I don't have a reason not to kill timers. I simply want to understand
> > Windows programming better.

> > In addition, I can think of a couple of reasons to have system timers
die
> > automatically at program termination. First, one less call to make or
> forget
> > to make. Second, a slight savings in executable size. Third, you don't
> have
> > to worry about the limited number of timers being used up by apps that
> don't
> > manage them properly.



> > > What I read is that you can kill your timer by calling KillTimer.
> > > Is there a reason for you not to want to call KillTimer??
> > > (If timer messages arrive to a still running application and your
> > > callback function is gone you will get errors)

> > > Erik



> > > > Yes. Those are pretty much the same docs I said I wasn't clear on.



> > > > > I think this might answer your question.
> > > > > Erik

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wces...

- Show quoted text -

Quote:
> > > > > /_wcesdk_win32_settimer.asp



> > > > > > I'm not quite clear reading the docs.

> > > > > > Is it necessary to kill a system timer created by an MFC app or
is
> > the
> > > > > timer
> > > > > > automatically terminated when the app quits?



Wed, 14 Sep 2005 19:47:39 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. SetTimer, KillTimer

2. SetTimer, KillTimer

3. KillTimer() fails to kill my timer

4. Cannot KillTimer()

5. SetTimer/KillTimer

6. SetTimer/KillTimer

7. SetTimer, KillTimer

8. Killtimer without SetTimer

9. CWnd::KillTimer() problem

10. KillTimer doesn't kill the timer.

11. KillTimer doesn't always work ?

12. KillTimer() fails to kill my timer

 

 
Powered by phpBB® Forum Software