代码:
var
MyObject: OleVariant;
begin
MyObject:=CreateOleObject('MyCOM.MyObject');
try
ShowMessage(MyObject.Test('黎明'));
finally
VarClear(MyObject);
end;
end;
执行.....并按Button1按键
你会看到一个Message...那就是执行COM对象的Test方法的回传值