很简单的代码,服务端用transaction object做的,只有一个方法,代码如下:
unit uExam1;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
ActiveX, Mtsobj, Mtx, ComObj, PExam1_TLB, StdVcl;
type
TmtsExam1 = class(TMtsAutoObject, ImtsExam1)
protected
function GetMessage: WideString;
safecall;
{ Protected declarations }
end;
implementation
uses ComServ;
function TmtsExam1.GetMessage: WideString;
begin
Result:='Returned from server';
end;
initialization
TAutoObjectFactory.Create(ComServer, TmtsExam1, Class_mtsExam1,
ciMultiInstance, tmApartment);
end.
客户端如此调用:
procedure TForm1.Button1Click(Sender: TObject);
var MessageObj:ImtsExam1;
begin
MessageObj:=comtsExam1.CreateRemote('TOMWLD');
Label1.Caption :=MessageObj.GetMessage;
end;
在我的机子可以运行,但复制到别人的机子上就不可以,
在组件服务里我也已经设置了,在客户端也安装了了导出文件,但是会出现如上的错误