[Lazarus] fpGUI Widget Type: TTimer fix

Michael Schnell mschnell at lumino.de
Wed Aug 31 09:58:32 CEST 2011


(using Linux X86 32 Bit):

Initiating TTimer with fpGUI Widget Type issues a Range check error: 
Project eventtest raises exception class 'RunError(201)'



line 153  is


Result := PtrInt(Timer);


PtrInt in fact is "LongInt".
When stepping my example the value for the Timer variable is $B761AA00.
So the Longint will be negative and as THandle is PtrUInt which again is 
DWord, a range check exception is raised.

Changing the line to


Result := THandle(Timer);


makes the Timer work in my example

I don't know if this is appropriate for all Archs....

-Michael




More information about the Lazarus mailing list