hi,

am using the SetTimer function and would like to know what happens when
i use two continuous SetTimer calls or KillTimer calls on the same
handle??

eg. i define a timer:

SetTimer with an ID, say ID1.

define it again with the same id, ID1.

According to documentation, this should just reset the timer. Does it
actually do taht?

But what would happen if i try to do the same with KillTimer??

Kill ID1 and then again call KillTimer with ID1.

thanx!!

Re: Continuous KillTimer or SetTimer calls by Doug

Doug
Sun Aug 21 17:44:40 CDT 2005

On 21 Aug 2005 12:01:31 -0700, "kcool" <karan.rath@gmail.com> wrote:

>hi,
>
>am using the SetTimer function and would like to know what happens when
>i use two continuous SetTimer calls or KillTimer calls on the same
>handle??
>
>eg. i define a timer:
>
>SetTimer with an ID, say ID1.
>
>define it again with the same id, ID1.
>
>According to documentation, this should just reset the timer. Does it
>actually do taht?

Yes. (Why would you think otherwise?)

>But what would happen if i try to do the same with KillTimer??
>
>Kill ID1 and then again call KillTimer with ID1.

The SetTimer calls don't nest, so nothing useful will be accomplished. At
best it will be harmless. I wouldn't do it.

--
Doug Harrison
VC++ MVP

Re: Continuous KillTimer or SetTimer calls by David

David
Sun Aug 21 17:44:16 CDT 2005

>am using the SetTimer function and would like to know what happens when
>i use two continuous SetTimer calls or KillTimer calls on the same
>handle??
>
>eg. i define a timer:
>
>SetTimer with an ID, say ID1.
>
>define it again with the same id, ID1.

Presumably you mean that you call SetTimer again?

>According to documentation, this should just reset the timer. Does it
>actually do taht?

To the best of my recollection, yes it does. Why don't you test it and
reassure yourself.

>But what would happen if i try to do the same with KillTimer??
>
>Kill ID1 and then again call KillTimer with ID1.

I'd expect the second use of KillTimer would return the failure code
(0).

As far as I know, there's no reference counting applied to Windows
timers - if that's what you're hinting at.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Re: Continuous KillTimer or SetTimer calls by kcool

kcool
Mon Aug 22 02:24:04 CDT 2005

Yes. reference counting was what i was hintin at. thanx