[Lazarus] Project Wizard fix

Juha Manninen juha.manninen at phnet.fi
Sat Feb 20 16:32:29 CET 2010


Hi Michael, thanks, is there a work around solution to simulating a trigger in a Lazdaemon?

Rgds,
Joshua


From: Michael Van Canneyt
The standard driver for fpTimer is not suitable for use in a daemon
application, as the timer events are only triggered in the main thread,
and each daemon runs in its own thread.

Michael.

From: joshua__lim
To: lazarus at lists.lazarus.freepascal.org
Subject: Having trouble getting fptimer to work in a Daemon.
Date: Mon, 15 Feb 2010 10:02:48 +0000








Hi,

I'm a pascal newbie, after spending some time getting a daemon to work, I now have trouble getting a timer to work.  I was recommended to use TFPTimer from the fpTimer unit - http://mantis.freepascal.org/view.php?id=14118&nbn=5

I tried the following code but the OnTimer doesn't trigger.  There are no errors either.  Grateful for any pointers.  :)

uses
fpTimer;
...
 TDaemon1 = class(TDaemon)
....
private
.....
public
    procedure FTimerTimer( Sender : TObject );  
.....
var
  Daemon1: TDaemon1;
  FTimer : TFPTimer;
.....
procedure TDaemon1.FTimerTimer( Sender : TObject );
var
...
 BEGIN
....
END;                 

procedure TDaemon1.DataModuleStart(Sender: TCustomDaemon; var OK: boolean);
var
...
begin    
 FTimer := TFPTimer.Create(nil);
 FTimer.OnTimer := @FTimerTimer;
 FTimer.Interval := 1000; // in milliseconds
 FTimer.Enabled := True;         
 FTimer.StartTimer;


Note: I've also posted here - http://lazarus.freepascal.org/index.php/topic,8615.0.html


 		 	   		  
Hotmail: Free, trusted and rich email service. Get it now. 		 	   		  
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20100219/3bd7e065/attachment-0004.html>


More information about the Lazarus mailing list