![]() |
TIdFTP: SendCmd überschreiben
Hallo,
ich stelle gerade um von D2005 auf D2010 und hab jetzt das Problem, dass bei einer Komponente die von TIdFTP abgeleitet ist, das Überschreiben von SendCmd nichtmehr akzeptiert wird:
Delphi-Quellcode:
Ich versteh jetzt nicht genau warum, TIdFTP selbst hat zwar kein SendCmd, allerdings hat TIdTCPConnection dieses SendCmd, also sollte es doch funktionieren. Oder wo denk ich hier falsch?
TMyFTP = class(TIdFTP)
private . . public function SendCmd(AOut: string; const AResponse: array of SmallInt) : SmallInt; override; end; end; function TMyFTP.SendCmd(AOut: string; const AResponse: array of SmallInt) : SmallInt; begin . . end; Edit: fast vergessen, die Fehlermeldung: [DCC Fehler] UMyFTP.pas(94): E2137 Methode 'SendCmd' nicht in Basisklasse gefunden |
Re: TIdFTP: SendCmd überschreiben
Hallo Angel4585,
etwas spät, aber hier die allgemeingültige Lösung für alle DPler: Zitat:
In D2009/2010 ist dies (siehe IdTCPConnection.pas):
Delphi-Quellcode:
In Deinem Fall also:
function SendCmd(AOut: string; const AResponse: SmallInt = -1;
AEncoding: TIdTextEncoding = nil): SmallInt; overload; function SendCmd(AOut: string; const AResponse: array of SmallInt; AEncoding: TIdTextEncoding = nil): SmallInt; overload; virtual; function SendCmd(AOut: string; const AResponse: string; AEncoding: TIdTextEncoding = nil): string; overload;
Delphi-Quellcode:
Alternativ kannst Du für Abwärtskompatibilität das ganze in IFDEFs packen:
TMyFTP = class(TIdFTP)
private . . public function SendCmd(AOut: string; const AResponse: array of SmallInt; AEncoding: TIdTextEncoding = nil): SmallInt; override; end; end; function TMyFTP.SendCmd(AOut: string; const AResponse: array of SmallInt; AEncoding: TIdTextEncoding = nil): SmallInt; begin . . end;
Delphi-Quellcode:
Gruß,
TMyFTP = class(TIdFTP)
private . . public function SendCmd(AOut: string; const AResponse: array of SmallInt; {$IFDEF UNICODE}AEncoding: TIdTextEncoding = nil{$ENDIF}): SmallInt; override; end; end; function TMyFTP.SendCmd(AOut: string; const AResponse: array of SmallInt; {$IFDEF UNICODE}AEncoding: TIdTextEncoding = nil{$ENDIF}): SmallInt; begin . . end; Assertor |
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:58 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