Jean-Marc Kiener Posted September 22, 2022 Share Posted September 22, 2022 Hello, I have following small TThread class: TOnProgress = procedure( Sender: TObject; Value: integer; Msg: string ) of object; TWorker = class(TThread) private { Private-Deklarationen } FMin: integer; FMax: integer; FOnProgress: TOnProgress; FProgressMsg: string; FPosition: integer; procedure DoOnProgress( aValue: integer; aMsg: string ); protected procedure Execute; override; public constructor Create( aOnProgress: TOnProgress ); reintroduce; property OnProgress: TOnProgress read FOnProgress write FOnProgress; property ProgressMsg: string read FProgressMsg; property Position: integer read FPosition; end; When i create the TWorker Object in a unigui form with a aOnProgress procedure parameter it does not work properly ( per example FWorker1 := TWorker.Create( UpdateGUI1 ); ). The TOnProgress method "UpdateGUI1" of the unigui form is called, but mostly it does nothing. I assume that i have to find the "right" unigui form instance from where the thread was called? Quote Link to comment Share on other sites More sharing options...
Ron Posted September 22, 2022 Share Posted September 22, 2022 I always use Synchronize() when updating the GUI from a thread. Quote Link to comment Share on other sites More sharing options...
boka Posted October 31, 2022 Share Posted October 31, 2022 doesn't work for me Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.