Autor Beitrag
NTcomputer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Windows 7 x64
Delphi 2005 PE
BeitragVerfasst: Mo 24.08.09 19:57 
Beim Erstellen eines neuen Threads zeigt Delphi ja folgende schöne Meldung:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
{ Wichtig: Methoden und Eigenschaften von Objekten in visuellen Komponenten dürfen 
  nur in einer Methode namens Synchronize aufgerufen werden, z.B.

      Synchronize(UpdateCaption);

  und UpdateCaption könnte folgendermaßen aussehen:

    procedure TTestThread.UpdateCaption;
    begin
      Form1.Caption := 'Aktualisiert in einem Thread';
    end; }

In meinem Fall wäre das statt "Form1" "InitForm", aber der Sachverhalt ist der gleiche:
Wie mache ich meinem Thread klar, dass InitForm das Formular des Hauptthreads ist und er drauf zugreifen kann?
Weil ich es nicht weiß meckert der Compiler immer:
[Fehler] Installer_SystemCheck.pas(69): E2003 Undefinierter Bezeichner: 'InitForm'

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 24.08.09 20:19 
Da fehlt dann wohl ein uses MainForm (oder wie deine Hauptunit auch heißt, in der InitForm definiert ist).

Da du die Thread-Unit wahrscheinlich dort brauchst und in der uses-Liste hast, musst das im Implementation-Teil tun - also nach dem Implemetation ein uses .. einfügen. Sonst bekommst du die nächste Fehlermeldung, von wegen überkreuzende Units oder so. ;-)

_________________
We are, we were and will not be.
NTcomputer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Windows 7 x64
Delphi 2005 PE
BeitragVerfasst: Di 25.08.09 17:32 
:think: Perfekt! Danke!