Z
zhaojianzhu
Unregistered / Unconfirmed
GUEST, unregistred user!
IChannelHandler = interface
['{C4FB64C4-44B2-4959-A51D-6E17FDB11891}']
procedure process(pack: TJabberPacket);
IRoutableChannelHandler = interface(IChannelHandler)
['{7DE991FE-F8EB-4326-A669-D080CE85B4FA}']
end;
TSession = class(TInterfacedObject,IRoutableChannelHandler)
end;
var
obj:TObject;
session:IChannelHandler ;
obj=TSession.create;
if obj.getInterface(IChannelHandler ,session) then
session.process;
为什么这么写就不能取到接口而必须这样
if obj.getInterface(IRoutableChannelHandler,session) then
session.process;
用什么方法可以实现类似这样的表达式:
session:=obj as IChannelHandler;
['{C4FB64C4-44B2-4959-A51D-6E17FDB11891}']
procedure process(pack: TJabberPacket);
IRoutableChannelHandler = interface(IChannelHandler)
['{7DE991FE-F8EB-4326-A669-D080CE85B4FA}']
end;
TSession = class(TInterfacedObject,IRoutableChannelHandler)
end;
var
obj:TObject;
session:IChannelHandler ;
obj=TSession.create;
if obj.getInterface(IChannelHandler ,session) then
session.process;
为什么这么写就不能取到接口而必须这样
if obj.getInterface(IRoutableChannelHandler,session) then
session.process;
用什么方法可以实现类似这样的表达式:
session:=obj as IChannelHandler;