补充: 服务器实现 function Thehe.Get_names: OleVariant; begin result:='hello'; end;
请问,我在服务器的 function Thehe.Set_names: OleVariant begin end; 写的代码的值会由 function Thehe.Get_names: OleVariant BeginEnd; 返回到前端吗?
TO :del_c_sharp 你给我的方法可以实瑞,我将代码写在 function Thehe.Get_names: OleVariant Begin End; 但是我想问一下function Thehe.Get_names: OleVariant Begin End; 的作用是什么呢,可以有范例代码吗以给我一份,不胜感激!!
var v:OleVariant; DCOMConnection1.AppServer.getstr(v); DCOMConnection1.AppServer.names:=v; 这样就可以把方法返回值,交给属性了 服务器端: procedure Thehe.getstr(var v: OleVariant) begin result:='nice to meet you!'; end;
哦,不好意思。笔误: 因该是 procedure Thehe.getstr(var v: OleVariant) begin v:='nice to meet you!'; end;
比如你有一个属性 names OleVariant类型
那么在客户端就可以用:
caption:=string(DCOMConnection1.AppServer.names);或者用creatremotecomobject,得到接口,然后再调用属性
服务器实现
function Thehe.Get_names: OleVariant;
begin
result:='hello';
end;
function Thehe.Set_names: OleVariant
begin
end;
写的代码的值会由
function Thehe.Get_names: OleVariant
BeginEnd;
返回到前端吗?
你给我的方法可以实瑞,我将代码写在
function Thehe.Get_names: OleVariant
Begin
End;
但是我想问一下function Thehe.Get_names: OleVariant
Begin
End;
的作用是什么呢,可以有范例代码吗以给我一份,不胜感激!!
v:OleVariant;
DCOMConnection1.AppServer.getstr(v);
DCOMConnection1.AppServer.names:=v;
这样就可以把方法返回值,交给属性了
服务器端:
procedure Thehe.getstr(var v: OleVariant)
begin
result:='nice to meet you!';
end;
因该是
procedure Thehe.getstr(var v: OleVariant)
begin
v:='nice to meet you!';
end;