首先,IDispatch与Iunknow有什么区别?
其次,我从接口IUnknow继承的类,在客户机写下面代码var
da:Itest;
begin
da:=cotest.create;
da.message;
end;
以上服务器代码为:
type
Ttestone = class( TMtsAutoObject, Itestone)
protected
function amess: HResult; stdcall;
{Declare Itestone methods here}
end;implementationuses ComServ;function Ttestone.message: HResult;
begin
showmessage('mi');
end;
正常运行。
可是如果我的类是从IDispatch继承的!就会出错。而且是灾难性错误!代码如下:
服务器:
type
Ttest = class(TMtsAutoObject , Itest)
protected
procedure message1; safecall;
end;implementationuses ComServ;procedure Ttest.message1;
begin
showmessage('mi');
end;
客户机代码同上
var
da:Itest;
begin
da:=cotest.create;
da.message;
end;请问如何从IDispatch接口继承,正确执行程序?
答对者,可以和此贴一起结分!
http://community.csdn.net/Expert/topic/3254/3254125.xml?temp=.4322321
其次,我从接口IUnknow继承的类,在客户机写下面代码var
da:Itest;
begin
da:=cotest.create;
da.message;
end;
以上服务器代码为:
type
Ttestone = class( TMtsAutoObject, Itestone)
protected
function amess: HResult; stdcall;
{Declare Itestone methods here}
end;implementationuses ComServ;function Ttestone.message: HResult;
begin
showmessage('mi');
end;
正常运行。
可是如果我的类是从IDispatch继承的!就会出错。而且是灾难性错误!代码如下:
服务器:
type
Ttest = class(TMtsAutoObject , Itest)
protected
procedure message1; safecall;
end;implementationuses ComServ;procedure Ttest.message1;
begin
showmessage('mi');
end;
客户机代码同上
var
da:Itest;
begin
da:=cotest.create;
da.message;
end;请问如何从IDispatch接口继承,正确执行程序?
答对者,可以和此贴一起结分!
http://community.csdn.net/Expert/topic/3254/3254125.xml?temp=.4322321
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货