Does accessing UI controls inside ComDataPacket.OnPacket needs
synchronization?
I have a ComPort1 and a ComDataPacket1 on my form and
ComDataPacket1.ComPort:= ComPort1;. I see that there is a properties
SyncMethod and I guess that TComPort creating a thread when
ComPort1.Connected:=true;.
Recently I realized that every UI access from OnExecute event of Indy
IdTCPServer component needs to be Synchronized with MainThread so is it
true for TComPort? How to do this(Indy has a class to doing this)?
I am reading data from com port like this(data is sent as packet so
ComDataPacket1 is very useful):
procedure TForm2.ComDataPacket1Packet(Sender: TObject; const Str: string);
begin
Label1.caption:= str;
end;
I am working on a project and sometimes I got famous "Your application has
stopped working" message box(When my program is closed). I am suspecting
this error is because of that.
No comments:
Post a Comment