J Jhdandcl Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-05 #1 如何理解Interface 型如何如何判断一个Interface 型变量是否已创建? 如果是个Class 我可以用 asinged()来判别,如果是Interface如何判断?
S Slong Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-05 #2 是不是这样: if varType(YourInterface) <> varDispatch then begin CoInitialize(nil); YourInterface := CreateOleObject('YourInterface') end;
是不是这样: if varType(YourInterface) <> varDispatch then begin CoInitialize(nil); YourInterface := CreateOleObject('YourInterface') end;
J Jhdandcl Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-06 #3 类似Slong的这个意识,不过Slong 的答案不能完全解决, 因为我的接口变量可不一定是IDispatch,
T txmaster Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-06 #4 一. try YourInterface.Method; showmessage("Yes!"); except showmessage("NO!") end; 二. if YourInterface<>nil then//这样行不行?我没试
一. try YourInterface.Method; showmessage("Yes!"); except showmessage("NO!") end; 二. if YourInterface<>nil then//这样行不行?我没试
D dedman Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-06 #5 if YourInterface = nil then showmessage('空');