I would like to know where I can place the CheckSynchronize() call in a GUI program such that it is executed regularly a few times per second at least?
In a console program I can put it in a loop at the end of the main program where also the exit conditions are checked and here the messaging from threads work.
But where could I place it in a GUI program?
I have problems receiving data from a TCPIP client I created using Indy10.
The data are retrieved from the wire in a thread and it is supposed to fire off an event when the data arrive. But it seems like CheckSynchronize needs to be executed regularly in the main thread in order for the event to be recognized...
Only I cannot find the main thread loop in a GUI program...
I would like to know where I can place the CheckSynchronize() call in a GUI program such that it is executed regularly a few times per second at least?
So I have created a derivative of the Indy10 IdTcpClient, which has a read thread built in such that I can have the incoming data supplied via an event (Indy itself is blocking and thus much more difficult to use when porting the applications which are built around the event model).
The server runs as a regular non-GUI program and I had to add CheckSynchronize to the main program loop to get the TCP/IP receive event working properly.
...
OOPS,
while typing this @PascalDragon states that LCL does this in a GUI program. If so the problem is something else...
hardware data collection system controlled via RS232Synaser works on a Raspberry Pi. For the Daemon, have a look at the example. The GUI should not produce many issues when ported to Lazarus.
- Enable the nogui widgetset in the server
- Change the button results of OK and Cancel on the client login form to mrOk and mrCancel. This should have been there from Delphi...