[lazarus] TTimer on Win32

Vincent Snijders vslist at zonnet.nl
Sat Sep 6 06:19:04 EDT 2003


On Fri, 5 Sep 2003 16:52:22 -0300
"Prof. Roberto A. Berrospe Machin" <binaryuniverse at binaryuniverse.com>
wrote:

> Why Timers in Win32 dont work?
> I try use, TTimer and TIdleTimer, but no work.
I have no problems with TTimer, I didn't TIdleTimer.

> The app compiles fine, but timer not work.
This surprises me. It shouldn't compiler.

> This is part of my code. 
> 
> Procedure TESTTIMER_ONTIMER();
> Begin
>     MAINFORM.TIMELABEL.Caption := 'Test';
>     Application.MessageBox('Test','test',1)
> End;
> 
> Constructor MAINFORMCLASS.Create(AOwner: TComponent);
> Begin
>      Inherited Create(AOwner);
>      Caption  := 'Timer Test';
>      Width  := 120;
>      Height  := 100;
>     TESTTIMER := TIdleTimer.Create(Self);
>     TESTTIMER.Interval  := 1000;
>     TESTTIMER.OnTimer  := @TESTTIMER_ONTIMER;
It should give an error on this line. The signature of TESTTIMER_ONTIMER
is wrong.
Either this is NOT your code, or you are using an old fpc compiler.

> End;
> 
> destructor MAINFORMCLASS.Destroy;
> begin
>      inherited Destroy;
> end;






More information about the Lazarus mailing list