RTC Forums

Subscription => Support => Topic started by: zxplzzc on November 12, 2011, 09:24:03 AM



Title: Accessing the GUI from events in MultiThreaded mode
Post by: zxplzzc on November 12, 2011, 09:24:03 AM
How can I  write the following codes correctly?
procedure TMainForm.RtcHttpClient1ConnectError(Sender: TRtcConnection;E: Exception);
begin
  if not Sender.inMainThread then
     Sender.Sync(RtcHttpClient1ConnectError);
  else
  begin
    RzStatusPane1.Caption:=E.Message;
  end;
end;

Thanks!


Title: Re: Accessing the GUI from events in MultiThreaded mode
Post by: zxplzzc on November 12, 2011, 09:51:39 AM
I see:
  Sender.Sync(RtcHttpClient1ConnectError,E)


Title: Re: Accessing the GUI from events in MultiThreaded mode
Post by: D.Tkalcec (RTC) on November 12, 2011, 10:23:57 AM
Correct. The Sync method needs to be called with the event to be synchronized and all the parameters which that event is receiving, except "Sender".

Best Regards,
Danijel Tkalcec