From: Karl E. Peterson on
MM has brought this to us :
> On Wed, 30 Jun 2010 13:52:47 -0700, Karl E. Peterson <karl(a)exmvps.org>
> wrote:
>
>> Brain freeze here, I guess.
>>
>> I need a simple one-shot timer (non form-based). I was thinking, just
>> use SetTimer, then call KillTimer in the callback. But, KillTimer
>> fails in the callback. LastDllError=0.
>>
>> What quick/easy way am I forgetting for a one-shot deal like this?
>> (Betting I need to go with mmTimers, but I've been staring at the
>> screen for too long, and need to stretch...)
>>
>> Thanks... Karl
>
> Why not use CCRP High Performance Timer Objects? Written by a pretty
> bright kid I'm told... ;)
>
> Works for me!

Heh, not a bad option at that, generally speaking! ;-)

Wouldn't have been appropriate in this case, though. (Did you see the
other thread about FindReplace?)

--
..NET: It's About Trust!
http://vfred.mvps.org


From: Dee Earley on
On 30/06/2010 21:52, Karl E. Peterson wrote:
> Brain freeze here, I guess.
>
> I need a simple one-shot timer (non form-based). I was thinking, just
> use SetTimer, then call KillTimer in the callback. But, KillTimer fails
> in the callback. LastDllError=0.
>
> What quick/easy way am I forgetting for a one-shot deal like this?
> (Betting I need to go with mmTimers, but I've been staring at the screen
> for too long, and need to stretch...)

Sub TimerProc(ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse
As Long, ByVal lpTimerFunc As Long)
Dim Handle As Long
Dim Caller As Callbackable

Handle = uElapse
KillTimer 0, Handle
....

Works fine for me.

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
From: Dee Earley on
On 02/07/2010 10:09, Dee Earley wrote:
> On 30/06/2010 21:52, Karl E. Peterson wrote:
>> Brain freeze here, I guess.
>>
>> I need a simple one-shot timer (non form-based). I was thinking, just
>> use SetTimer, then call KillTimer in the callback. But, KillTimer fails
>> in the callback. LastDllError=0.
>>
>> What quick/easy way am I forgetting for a one-shot deal like this?
>> (Betting I need to go with mmTimers, but I've been staring at the screen
>> for too long, and need to stretch...)
>
> Sub TimerProc(ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse
> As Long, ByVal lpTimerFunc As Long)
> Dim Handle As Long
> Dim Caller As Callbackable
>
> Handle = uElapse
> KillTimer 0, Handle
> ...
>
> Works fine for me.

I see you've found the problem now, but it's a prime example of why
people should show us the code in question... :p

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
From: Tony Toews on
On Fri, 02 Jul 2010 10:44:18 +0100, Dee Earley
<dee.earley(a)icode.co.uk> wrote:

>I see you've found the problem now, but it's a prime example of why
>people should show us the code in question... :p

Are you pioking a stick in Karl's cage? <smile>

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
From: Karl E. Peterson on
Tony Toews formulated on Friday :
> On Fri, 02 Jul 2010 10:44:18 +0100, Dee Earley
> <dee.earley(a)icode.co.uk> wrote:
>
>> I see you've found the problem now, but it's a prime example of why
>> people should show us the code in question... :p
>
> Are you pioking a stick in Karl's cage? <smile>

Heheheh... A well deserved one! <bg>

--
..NET: It's About Trust!
http://vfred.mvps.org