WinCE下IE怎么使用我编写的ActiveX控件。
环境VS2005,MFC ActiveX控件,WinCE6.0.
我自己用VS2005编写的ActiveX控件,怎么才能让IE调用起来。
编译生成的文件名为ActiveXDemo.ocx,程序调用DllRegisterServer成功后,注册表中也有CLSID,
网页代码如下:
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>ActiveXDemo测试</title><script type="text/javascript"> function getMainIDFun() { try{ var demo = document.getElementById('ActiveXProperty_1'); //var iResult = demo.getMainID("laiziwangye", 11); alert(iResult); } catch(e){ alert("控件未安装"); } }</script></head><body><object id="AcitveXDemo" classid="clsid: AF7B734F-3991-48F1-AEBA-4AE89232D9B6" WIDTH=10 HEIGHT=10 </object> <fieldset><legend>ActiveXDemo测试</legend> <table width="100%" border="1"> <tr> <td width="20%"><input type="button" onclick="getMainIDFun();" value='getMainIDFun'> </td> </tr> </table></fieldset></body></html>
[ uuid(88E78CCA-7036-43FF-B9D0-42C7094DA19D), version(1.0), helpfile("ActiveXDemo.hlp"), helpstring("ActiveXDemo ActiveX 控件模块"), control ]library ActiveXDemoLib{ importlib(STDOLE_TLB); importlib(STDTYPE_TLB); // CActiveXDemoCtrl 的主调度接口 [ uuid(4D87AEC0-38AC-425B-AE1C-C66627412E89), helpstring("ActiveXDemo Control 的调度接口"), hidden] dispinterface _DActiveXDemo { properties: methods: [id(1), helpstring("方法getMainID")] BSTR getMainID(BSTR cmos_id, LONG lid); }; // CActiveXDemoCtrl 的事件调度接口 [ uuid(A6C56FB0-5C57-4109-AA45-3A8ACD2BB1E1), helpstring("ActiveXDemo Control 的事件接口") ] dispinterface _DActiveXDemoEvents { properties: // 事件接口没有任何属性 methods: }; // CActiveXDemoCtrl 的类信息 [ uuid(AF7B734F-3991-48F1-AEBA-4AE89232D9B6), helpstring("ActiveXDemo Control"), control ] coclass ActiveXDemo { [default] dispinterface _DActiveXDemo; [default, source] dispinterface _DActiveXDemoEvents; };};