L
lizheng
Unregistered / Unconfirmed
GUEST, unregistred user!
...
IName = Interface
Function GetName: String;
TMyClass = class(TObject, IName)
Function GetName: String;
...
Function TMyClass.GetName: String;
begin
Result := 'IName';
end;
...
Form1 = Class(TForm)
...
private
FIName: IName;
FMyClass : TMyClass;
Procedure YINYONG;
...
Procedure Form1.YINYONG;
begin
FMyClass := MyClass.Create;
FIName := FMyClass;
//这样算不算引用一个接口,
//如果算,在程序中我怎样才能两次引用这个接口IName.
...
end;
IName = Interface
Function GetName: String;
TMyClass = class(TObject, IName)
Function GetName: String;
...
Function TMyClass.GetName: String;
begin
Result := 'IName';
end;
...
Form1 = Class(TForm)
...
private
FIName: IName;
FMyClass : TMyClass;
Procedure YINYONG;
...
Procedure Form1.YINYONG;
begin
FMyClass := MyClass.Create;
FIName := FMyClass;
//这样算不算引用一个接口,
//如果算,在程序中我怎样才能两次引用这个接口IName.
...
end;