AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Problem bei Ableitung von TIdTCPClient (Override von Create)
Thema durchsuchen
Ansicht
Themen-Optionen

Problem bei Ableitung von TIdTCPClient (Override von Create)

Ein Thema von christian.noeding · begonnen am 9. Dez 2008 · letzter Beitrag vom 9. Dez 2008
 
Benutzerbild von christian.noeding
christian.noeding

Registriert seit: 26. Mai 2005
Ort: Knw.-Remsfeld
119 Beiträge
 
Delphi XE2 Professional
 
#6

Re: Problem bei Ableitung von TIdTCPClient (Override von Cre

  Alt 9. Dez 2008, 12:30
Danke für den Tipp, aber es kommt der gleiche Fehler "Statische Methode kann nicht überschrieben werden".

Kann es daran liegen, dass IdTCPClientCustom die Funktionen z.T. überlädt? Zudem werden die Funktionen "Create" und "Disconnect" offensichtlich durch TIdTCPConnection geerbt. Somit müsste ich ja grundlegende Funktionen der Indys anpassen... Siehe hier:

Delphi-Quellcode:
  TIdTCPClientCustom = class(TIdTCPConnection)
  protected
    FBoundIP: String;
    FBoundPort: Integer;
    FBoundPortMax: Integer;
    FBoundPortMin: Integer;
    FConnectTimeout: Integer;
    FDestination: string;
    FHost: string;
    FIPVersion: TIdIPVersion;
    FOnConnected: TIdNotifyEvent;
    FPassword: string;
    FPort: TIdPort;
    FReadTimeout: Integer;
    FUsername: string;
    //
    FOnBeforeBind: TIdNotifyEvent;
    FOnAfterBind: TIdNotifyEvent;
    //
    procedure DoOnConnected; virtual;
    function MakeImplicitClientHandler: TIdIOHandler; virtual;
    //
    procedure SetConnectTimeout(const AValue: Integer);
    procedure SetReadTimeout(const AValue: Integer);
    procedure SetBoundIP(const AValue: String);
    procedure SetBoundPort(const AValue: Integer);
    procedure SetBoundPortMax(const AValue: Integer);
    procedure SetBoundPortMin(const AValue: Integer);
    procedure SetHost(const AValue: string); virtual;
    procedure SetPort(const AValue: TIdPort); virtual;
    procedure SetIPVersion(const AValue: TIdIPVersion); virtual;
    //
    procedure SetOnBeforeBind(const AValue: TIdNotifyEvent);
    procedure SetOnAfterBind(const AValue: TIdNotifyEvent);
    //
    procedure SetIOHandler(AValue: TIdIOHandler); override;
    procedure InitComponent; override;
    //
    function GetReadTimeout: Integer;
    //
    property Host: string read FHost write SetHost;
    property IPVersion: TIdIPVersion read FIPVersion write SetIPVersion;
    property Password: string read FPassword write FPassword;
    property Port: TIdPort read FPort write SetPort;
    property Username: string read FUsername write FUsername;
    //
    property OnConnected: TIdNotifyEvent read FOnConnected write FOnConnected;
  public
    procedure Connect; overload; virtual;
    // This is overridden and not as default params so that descendants
    // do not have to worry about the arguments.
    // Also has been split further to allow usage from C# as it does not have optional
    // params
    procedure Connect(const AHost: string); overload;
    procedure Connect(const AHost: string; const APort: Integer); overload;
    function ConnectAndGetAll: string; virtual;

    property BoundIP: string read FBoundIP write SetBoundIP;
    property BoundPort: Integer read FBoundPort write SetBoundPort default 0;
    property BoundPortMax: Integer read FBoundPortMax write SetBoundPortMax;
    property BoundPortMin: Integer read FBoundPortMin write SetBoundPortMin;

    property ConnectTimeout: Integer read FConnectTimeout write SetConnectTimeout;
    property ReadTimeout: Integer read GetReadTimeout write SetReadTimeout;
    property OnBeforeBind:TIdNotifyEvent read FOnBeforeBind write SetOnBeforeBind;
    property OnAfterBind:TIdNotifyEvent read FOnAfterBind write SetOnAfterBind;

  published
  end;
Christian Nöding
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:14 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