Einzelnen Beitrag anzeigen

SimStar001

Registriert seit: 18. Jan 2008
594 Beiträge
 
#1

Problem mit create bei eigener Klasse

  Alt 13. Mai 2009, 10:51
Hallo, her mal der Code der Eigenen Klasse:

Delphi-Quellcode:
unit Livetrack;

interface

uses IdFTP, IdHTTP;

type TFTP = class(TIDFTP)
    end;

type THTTP = class(TIDHTTP)
    end;

type TLivetrack = class(TObject)
      private
      {private Vars}
      FHTTP : THTTP;
      FFTP : TFTP;
      FCacheDirectory : string;
      FFTPHost : String;
      FFTPDirectory : String;
      FFTPLoginName : String;
      FFTPPassword : String;
      FHTTPUrl : String;
      FFileName : String;
      FVID : String;

      {Set Procedures}
      procedure SetCacheDirectory(Directory : String);
      procedure SetFTPHost(Host : String);
      procedure SetFTPDirectory(Directory : String);
      procedure SetFTPLoginName(LoginName : String);
      procedure SetFTPPassword(Password : String);
      procedure SetHTTPUrl(URL : String);
      procedure SetFileName(FileName : String);
      procedure SetVID(VID : String);

      {get Functions}
      function GetCacheDirectory : String;
      function GetFTPHost : String;
      function GetFTPDirectory : String;
      function GetFTPLoginName : String;
      function GetFTPPassword : String;
      function GetHTTPUrl : String;
      function GetFileName : String;
      function GetVID : String;

      public
      {Functions}
      constructor create(const CacheDirectory : String; const FTPHost : string; const FTPDirectory : string; const FTPLoginName : string; const FTPPassword : string; const HTTPUrl : String; const FileName : String; const VID : string); overload;
      constructor create(const CacheDirectory : String; const FTPHost : string; const FTPDirectory : string; const FTPLoginName : string; const FTPPassword : string; const HTTPUrl : String; const FileName : String); overload;
      destructor free ;

      {properties}
      property CacheDirectory : String read GetCacheDirectory write SetCacheDirectory;
      property FTPHost : String read GetFTPHost write SetFTPHost;
      property FTPDirectory : String read GetFTPDirectory write SetFTPDirectory;
      property FTPLoginName : String read GetFTPLoginName write SetFTPLoginName;
      property FTPPassword : String read GetFTPPassword write SetFTPPassword;
      property HTTPUrl : String read GetHTTPUrl write SetHTTPUrl;
      property FileName : String read GetFileName write SetFileName;
      property VID : String read GetVID write SetVID;
      end;

implementation

{Set Procedures}

procedure TLivetrack.SetCacheDirectory(Directory : String);
begin

end;

procedure TLivetrack.SetFTPHost(Host : String);
begin

end;

procedure TLivetrack.SetFTPDirectory(Directory : String);
begin

end;

procedure TLivetrack.SetFTPLoginName(LoginName : String);
begin

end;

procedure TLivetrack.SetFTPPassword(Password : String);
begin

end;

procedure TLivetrack.SetHTTPUrl(URL : String);
begin

end;

procedure TLivetrack.SetFileName(FileName : String);
begin

end;

procedure TLivetrack.SetVID(VID : String);
begin

end;
// Ende Set Procedures

////////////////////////////////////////////////////////////////////////////////


{Get Functions}

function TLivetrack.GetCacheDirectory : String;
begin

end;

function TLivetrack.GetFTPHost : String;
begin

end;

function TLivetrack.GetFTPDirectory : String;
begin

end;

function TLivetrack.GetFTPLoginName : String;
begin

end;

function TLivetrack.GetFTPPassword : String;
begin

end;

function TLivetrack.GetHTTPUrl : String;
begin

end;

function TLivetrack.GetFileName : String;
begin

end;

function TLivetrack.GetVID : String;
begin

end;
// Ende Get Functions

////////////////////////////////////////////////////////////////////////////////


{Constructor}

constructor TLivetrack.create(const CacheDirectory : String; const FTPHost : string; const FTPDirectory : string; const FTPLoginName : string; const FTPPassword : string; const HTTPUrl : String; const FileName : String);
begin
  inherited create;

  self.FFTP := TFTP.Create();
end;

constructor TLivetrack.create(const CacheDirectory : String; const FTPHost : string; const FTPDirectory : string; const FTPLoginName : string; const FTPPassword : string; const HTTPUrl : String; const FileName : String; const VID : string);
begin

end;
// Ende Constructor

////////////////////////////////////////////////////////////////////////////////


{Destructor}

destructor TLivetrack.free;
begin

end;
// Ende Destructor

////////////////////////////////////////////////////////////////////////////////

end.

Ich habe jetzt folgendes Problem:

Wenn ich beim Constructor von TLivetrack einen IDFTP erzeugen will, muss man ja TComponent des Besitzers angeben. Wie mache ich das? Er gehört ja zum Object Livetrack...
  Mit Zitat antworten Zitat