![]() |
[TThread] - Startet nicht
Ich benutzte das erstemal das Thread-Objekt und habe schon ein Problem: Und zwar startet der Thread nicht.
Hier mal die Wichtigen Codestellen: (Erstellen des Threads)
Delphi-Quellcode:
(Starten des Threads)
thread := tTest.Create(true);
thread.qdPath := qdPath; thread.FreeOnTerminate := true;
Delphi-Quellcode:
(Executemethode)
tStart.Enabled := false;
thread.Resume;
Delphi-Quellcode:
(UpdateCaptionmethode)
procedure tTest.Execute;
begin ready := true; while ready do begin ShowMessage(''); <!--- Wird nicht angezeigt! if RenameFile(qdPath, qdPath + 't') then begin if newCaption <> 'a' then begin newCaption := 'a'; Synchronize(UpdateCaption); end; RenameFile(qdPath + 't', qdPath); end else begin if newCaption <> 'r' then begin newCaption := 'r'; Synchronize(UpdateCaption); end; end; end; end;
Delphi-Quellcode:
Er führt .Resume aus, aber den Rest nicht mehr...
procedure tTest.UpdateCaption;
begin frmUpdate.lReady.Caption := newCaption; frmUpdate.bUpdate.Enabled := newCaption = 'a'; end; PS: Keine Exceptions! |
Re: [TThread] - Startet nicht
Showdialog ist eine VCL-Funktion und muss mit Snychronize aufgerufen. Versuche es statt dessen mal mit Messagebox.
|
Re: [TThread] - Startet nicht
Hmmm... Ich habs jetzt mal debugt un bekomme einen Error (juhu ^^)
Omfg... Ich hatte einmal das "override; hinter "Execute" ausgeklammert, und jetzt funzt es ... Sry für den Thread :( |
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:59 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz