From: Willie Moore on
Bob,

I am using the timer method from one of my apps in 2.8 and am not having any
difficulties. Here is some parts stripped down. Hope it helps. If you need a
working sample, please let me know and I can put something together.

Regards,
Willie

CLASS GR8Email INHERIT datawindow
PROTECT lLeaveNow AS LOGIC
PROTECT nTimerHandle AS DWORD
PROTECT nTimeout AS LONG
PROTECT lTimerInit AS LOGIC
PROTECT lFirstTime AS LOGIC

METHOD Dispatch(oE) CLASS GR8Email

IF oE:Message == WM_TIMER
// If we get a timer message, call our timer event
SELF:runproc()
ELSEIF oE:Message == WM_DESTROY
// If a timer is still active
IF SELF:nTimerHandle > 0
// Kill it
KillTimer(SELF:handle(),1)
ENDIF ENDIF
// Now continue with deafult processing
RETURN SUPER:dispatch(oE)

METHOD StartTimer() AS VOID PASCAL CLASS GR8Email
// If there is no timer active
IF SELF:nTimerHandle == 0
// Create a new times
SELF:nTimerHandle := SetTimer(SELF:handle(),1,SELF:nTimeOut,NULL_PTR)
// Call the timer Method
SELF:timer()
SELF:lTimerInit := TRUE
ENDIF
RETURN
METHOD StopTimer() AS VOID PASCAL CLASS GR8Email
// If a timer is active
IF SELF:nTimerHandle > 0
// Kill the timer
KillTimer(SELF:handle(),1)
// Reset the timer handle
SELF:nTimerHandle := 0
SELF:lTimerInit := FALSE
ENDIF RETURN
METHOD SetTimerInterval() AS VOID PASCAL CLASS GR8Email
SELF:nTimeout := 500 // timer interval in miliseconds RETURN

METHOD RunProc() AS VOID PASCAL CLASS GR8EMAIL
LOCAL oError AS USUAL
LOCAL bErrBlock AS CODEBLOCK
LOCAL cReturnText AS STRING
LOCAL lLeave AS LOGIC
LOCAL hResult AS LONG

#IFDEF __DEBUG
_DebOut32( String2Psz( "Entering: " +__ENTITY__ ))
#ENDIF

bErrBlock := ErrorBlock({|oErr| _Break(oErr)})
BEGIN SEQUENCE
lLeave := FALSE
SELF:StopTimer()
//
************************************************************
// * Your processing code goes here
*
//
************************************************************
SELF:StartTimer() // go back to sleep till we are
needed again
RECOVER USING oError
//
************************************************************
//* your error handling here
//*************************************************************
END SEQUENCE
ErrorBlock(bErrBlock)
#IFDEF __DEBUG
_DebOut32( String2Psz( "Leaving: " +__ENTITY__ ) )
_DebOut32( String2Psz( "Result code : " + NTrim(hResult)) )
#ENDIF
RETURN





__________ Information from ESET NOD32 Antivirus, version of virus signature database 4641 (20091127) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



From: ciderbob on
I have used settimer in numerus apps and never had a problem. As is
said it works fine in 2.7 but 2.8 is messing with me. I have tried
trapping it with debug to look at the messages but WM_TIMER is never
sent.
From: Willie Moore on
Bob,

What you didn't post in your code was how you are starting the timer. I have
a timerSLE in rightSLE and I use the timer to run processing logic at set
intervals in another program. Both are working in 2.8 sp3 (the have worked
in all 2.8 versions).

Regards,
Willie


"ciderbob" <bobmcc03(a)gmail.com> wrote in message
news:73305113-cd80-422a-a685-17ec38f7625b(a)h2g2000vbd.googlegroups.com...
> I have used settimer in numerus apps and never had a problem. As is
> said it works fine in 2.7 but 2.8 is messing with me. I have tried
> trapping it with debug to look at the messages but WM_TIMER is never
> sent.
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4641 (20091127) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4641 (20091127) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



From: ciderbob on
METHOD dispatch(oevent) CLASS waitwin
? oevent:message
RETURN SUPER:dispatch(oevent)
From: ciderbob on
On Nov 27, 10:50 am, ciderbob <bobmc...(a)gmail.com> wrote:
in postinit()
SetTimer(self:handle(),1,100,null_ptr)

METHOD dispatch(oevent) CLASS waitwin
? oevent:message
RETURN SUPER:dispatch(oevent)

Rest of the message

Here is the output from the dispatch

295
296
13
12
70
131
71
131
12
70
71
3
70
71
28
134
6
641
642
7
8
641
12
24
70
133
20
71
31
10
528
20
70
71
134
6
28
2
70
131
71
295
296
13
12
70
131
71
131
12
70
71
3
70
134
6
641
642
7
8
641
12
24
70
133
20
71
31
10
528
20
70
71
134
6
2
70
131
71
No WM_TIMER ( 275) sent