Js 调用ActiveX接口返回值出错 我activeX定义了一个函数 Function getResult(sStr:widestring): widestring;我在delphi调用的时候 是有返回值的, 而在Js里面调用 时调用成功了, 但是没有返回值, js提示 undefined 。js调用 定义一个变量 然后赋值 给 getresult, 最后alert 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <htmL><head> <title>测试网页</title> <script language="javascript"> function test(){ var Constr = "", FID = "", version = "", Worker = "系统管理员", sPath = "F:\故事.doc;F:\歌曲\下载\联系方式.txt;", extend = "", bCon = "1"; var obj = document.getElementById("testOcx"); var returnValue = obj.UpLoadFile(Constr,FID,version,Worker,sPath,extend,bCon); alert(returnValue); } </script></head><body> <OBJECT id="testOcx" style="display:none;" classid="clsid:2166312F-0211-4E2C-AF86-E1CC1AC67F89" codebase="E:/Test WebFR/WebFastReport.cab#version=1,1,0,1" width=591 height=337 align=center hspace=0 vspace=0 ></OBJECT> <input type="button" onclick="test()" value="测试"/></body></htmL> 没用过cab调用,我只会调用ocx cab 只是 ocx的打包压缩形式啊~ 你在UpLoadFile函数加入些测试的东西,例如把返回输入的结果,在控件里ShowMessage一下,看是哪里有问题 Type Library当中这个函数是如何定义? HRESULT _stdcall UpLoadFile([in] BSTR Connstr, [in] BSTR FID, [in] BSTR version, [in] BSTR Worker, [in] BSTR sPath, [in] BSTR extend, [out, retval] BSTR * Value ); 小雪,记事 ADO 连接Excel 的问题 如何实现服务器与子机的通信 也祝亮劍拔牙順利,凱旋歸來 如何编写支持cgi和isapi的http服务器。如果简单的http服务器已经调试成功,现在想支持更多的功能 各位大虾,谁能帮帮忙! 在Win98下显示不对 如何传输一个record? 怎样生成注册码? 关于msde? 请教delphi如何调用外部的公式? 如果把自定义资源里的音乐文件地址存放到数组里?
<htmL>
<head>
<title>测试网页</title>
<script language="javascript">
function test(){
var Constr = "",
FID = "",
version = "",
Worker = "系统管理员",
sPath = "F:\故事.doc;F:\歌曲\下载\联系方式.txt;",
extend = "",
bCon = "1";
var obj = document.getElementById("testOcx");
var returnValue = obj.UpLoadFile(Constr,FID,version,Worker,sPath,extend,bCon);
alert(returnValue); }
</script>
</head>
<body>
<OBJECT id="testOcx" style="display:none;"
classid="clsid:2166312F-0211-4E2C-AF86-E1CC1AC67F89"
codebase="E:/Test WebFR/WebFastReport.cab#version=1,1,0,1"
width=591
height=337
align=center
hspace=0
vspace=0
></OBJECT> <input type="button" onclick="test()" value="测试"/>
</body>
</htmL>