This is the most difficult thing i faced programming in +25K code lines app
Using Lazarus 1.2.4 on Windows 7 premium
Is a server-client app.
The server have a TTimer (Lets call it TimerCrazy), with an interval of 1000. Since i developed the server first, i added some buttons, only for debug, to simulate the server requests.
Example:
procedure TForm1.TimerCrazyOnTimer(Sender: TObject);
begin
stuff...
end;
procedure TForm1.BTPayClick(Sender: TObject);
begin
ProcessComand('pay');
end;
There is a procedure called ProcessComand which do different things according to the command, sometimes turning on and sometimes turnin off the CrazyTimer
Everything works ok when i use this buttons, and the server sents to the client the apropiate answers when i use the debug buttons.
Finally, y added to the client the ability to make the requests, so he client user can make the request whenever they want. The code is very simple.
ClientSayToServer := 'pay';
In the OnExecute procedure of the server, it just read the line and send it to processcomand(String);
Everytings works as expected but TimerCrazy, which never again runs TimerCrazyOnTimer, and im sure that is enabled (i added a new buttons to check its state and is enabled = true)
procedure TForm1.ButtonDebug(Sender: TObject);
begin
MemoDebug.lines.add('TimerCrazy State = '+booltostr(TimerCrazy.Enabled,true));
end;
Is enabled, but its on-timer procedure is not executed never again (i even try setting interval to 1 but it do not works neither)
Since im doing the same thing but from different sources i assume this "bug" is related to the sender of the ontime procedure. How i could fix this? Actually, what use have the sender parameter in a ontimer procedure? If i just delete it from the procedure, i get a sivsig error
EDIT
I added this to he debug button to check if the TimerCrazy could "back to live" if it is called from a button
procedure TForm1.ButtonDebug(Sender: TObject);
begin
MemoDebug.lines.add('TimerCrazy State = '+booltostr(TimerCrazy.Enabled,true));
TimerCrazy.Enabled := true;
end;
But the TimerCrazy do not elapsed again neither.