Einzelnen Beitrag anzeigen

iphi

Registriert seit: 13. Feb 2009
262 Beiträge
 
Delphi 7 Personal
 
#1

warum sehe ich public und published properties nicht?

  Alt 26. Okt 2009, 10:23
Hallo,

Ich habe zum experimentieren ein Thread-Objekt wie folgt definiert:

Delphi-Quellcode:
unit UThreadCapture;

interface

...

type
  TCapture = class(TThread)
  private
    { Private declarations }
    s: string;
    ...
  protected
    ...
  public
    function test: boolean;
    ...
  published
    property ssss : string read s write s;
  end;

implementation
...
So weit so gut. Im Hauptprogramm möchte ich es nutzen:

Delphi-Quellcode:
var
  Capture: TThread;

...

Capture := TCapture.Create(true); //so weit so gut
Capture.test; //kennt der Compiler nicht obwohl public!????
writeln(Capture.ssss); //kennt der Compiler nicht obwohl published!????
Warum kann ich im Hauptprogramm nicht auf die public und published Methoden und Properties des Threadobjekts zugreifen? Was habe ich übersehen? Das müsste doch eigentlich so gehen. (Meine Frage zielt jetzt nicht auf Threadingsicherheit, sondern auf den Compiler).

Gruß, Thomas
  Mit Zitat antworten Zitat