服务器端:一。定义的接口unit U_Iface;interfaceuses Windows, Messages, SysUtils, Variants,ComObj;type
Iface=interface
['{CBE6FFE7-AF31-417D-AEE7-799593FB8ADB}']
function TestOut(const Sql: WideString): Integer; safecall;end;implementationend.二。类实现接口unit U_IIface;interfaceuses Windows, Messages, SysUtils, Variants,ComObj,U_Iface,Dialogs;type
IIface=class(TinterfacedObject,Iface)
private protected
public
function TestOut(const Sql: WideString): Integer; safecall;
end;implementation
function IIface.TestOut(const Sql: WideString): Integer;begin
Result:=1;
//ShowMessage('OK');
end;
end.三。客户端调用
sql:='123';
DM.DCOMConnection1.Connected:=true; DM.DCOMConnection1.AppServer.TestOut(sql);像我上面那样写为什么会报灾难性故障呢?
Iface=interface
['{CBE6FFE7-AF31-417D-AEE7-799593FB8ADB}']
function TestOut(const Sql: WideString): Integer; safecall;end;implementationend.二。类实现接口unit U_IIface;interfaceuses Windows, Messages, SysUtils, Variants,ComObj,U_Iface,Dialogs;type
IIface=class(TinterfacedObject,Iface)
private protected
public
function TestOut(const Sql: WideString): Integer; safecall;
end;implementation
function IIface.TestOut(const Sql: WideString): Integer;begin
Result:=1;
//ShowMessage('OK');
end;
end.三。客户端调用
sql:='123';
DM.DCOMConnection1.Connected:=true; DM.DCOMConnection1.AppServer.TestOut(sql);像我上面那样写为什么会报灾难性故障呢?
解决方案 »
- 问一个DELPHI快捷键
- 数据插入、更新问题?
- turbo delphi,用Bde连接mssql数据,有错,有谁碰过?
- 请教怎么把一个grid中的数据都打印出来
- 找男朋友,认真 + 严肃 。嘿嘿
- 散分了!散分了!
- 一个很简单的SQL查询问题!
- 为何在DELPHI6下无法使用TDBLookUpCombobox组件?竟然连text属性都没有,郁闷。
- 在Install shield中,如何把一个目录一次性放入安装文件中。而不是现在的一个一个添文件目录。
- 为什么我的客户端winsocket的send不能激活服务器端的read
- delphi 中在DLL中操作treeview的问题,请各位大侠指教。
- 菜鸟问题一大堆
RemoteDataModule调用接口Ifacetype
TPFunds = class(TRemoteDataModule, IPFunds)
DataSetProvider1: TDataSetProvider;
procedure RemoteDataModuleCreate(Sender: TObject);
private
Iface:Iface;end;implementationuses U_IIface;function TPFunds.TestOut(const Sql: WideString): Integer;
begin
Result:=Iface.TestOut(Sql);
end;procedure TPFunds.RemoteDataModuleCreate(Sender: TObject);
begin
Iface:= TIface.create;
end;end.