Einzelnen Beitrag anzeigen

Benutzerbild von stoxx
stoxx

Registriert seit: 13. Aug 2003
1.111 Beiträge
 
#3

Re: implements und Schnittstellen

  Alt 25. Mär 2004, 14:44
ähm .. nee .. sorry

ich meinte implements in Interfaces, siehe Code
Das Beispiel ist aus der Delphi Hilfe, sehe aber keinen Sinn darin irgendwie ? !

Code:
type
  IMyInterface = interface
    procedure P1;
    procedure P2;
  end;
  TMyClass = class(TObject, IMyInterface)
    FMyInterface: IMyInterface;
    property MyInterface: IMyInterface read FMyInterface implements IMyInterface;
  end;
var
  MyClass: TMyClass;
  MyInterface: IMyInterface;
begin
  MyClass := TMyClass.Create;
  MyClass.FMyInterface := ... // Einige Objekte, deren Klasse IMyInterface implementiert

  MyInterface := MyClass;
  MyInterface.P1;
end;
  Mit Zitat antworten Zitat