L
liop
Unregistered / Unconfirmed
GUEST, unregistred user!
高手,帮忙一下啊,给个代码,分不够可以加!!!!
代码如下:
Com中的代码:
procedure Tcch.Create(sTitle: OleVariant);
begin
//如何得到sTitle的值?
end;
//执行以下代码会出现错误信息:Invalid Variant type
function Tcch.GetTitle:OleVariant;
begin
try
Result := VarArrayCreate ([0,1], varVariant);
Result[0]:='str';
except
on E: Exception do ShowMessage(E.Message)
end;
end;
Web调用:
<SCRIPT language=javascript>
function test()
{ var sTitle = new Array(2);
sTitle[0]='a1';
sTitle[1]='a2';
document.all.cch.create(sTitle);
}
function test1()
{ var sTitle;
sTitle=document.all.cch.GetTitle();
}
</SCRIPT>
代码如下:
Com中的代码:
procedure Tcch.Create(sTitle: OleVariant);
begin
//如何得到sTitle的值?
end;
//执行以下代码会出现错误信息:Invalid Variant type
function Tcch.GetTitle:OleVariant;
begin
try
Result := VarArrayCreate ([0,1], varVariant);
Result[0]:='str';
except
on E: Exception do ShowMessage(E.Message)
end;
end;
Web调用:
<SCRIPT language=javascript>
function test()
{ var sTitle = new Array(2);
sTitle[0]='a1';
sTitle[1]='a2';
document.all.cch.create(sTitle);
}
function test1()
{ var sTitle;
sTitle=document.all.cch.GetTitle();
}
</SCRIPT>