如何用javascript将一段数据传给activex? javascript好像没有struct类型,也不能memcpy,我怎么传给activex里面呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用流(IStream)Command what is yoursConquer what is not 用流(IStream)怎样用啊??? javascript和vbscript这样的脚本语言调用com组件使用的是自动化模式,其所有变量都是variant型的,所以在com(activeX)的输入和输出接口中变量只能使用variant(VARIANT*)型.其中对于com输入参数,可以在输入后在com线程内将variant变换成相应的变量类型,你可以使用VariantChangeType函数进行转换;对于com输出参数,javascript和vbscript都会自动为你进行转换,所以在脚本线程内不必对类型转换过多考虑,只是偶尔会转换的类型不能满足你的需要时,才进行一些强制转换,如在vbscript中使用CInt,在javascript中使用parseFloat等函数. 没有IDispatch接口,javascript是没办法支持IStream的。我的做法是自己定义一个自动化对象用来传递数据。比如像这样: interface IPoint : IDispatch { [propget, id(1), helpstring("property x")] HRESULT x([out, retval] long *pVal); [propput, id(1), helpstring("property x")] HRESULT x([in] long newVal); [propget, id(2), helpstring("property y")] HRESULT y([out, retval] long *pVal); [propput, id(2), helpstring("property y")] HRESULT y([in] long newVal); HRESULT GetPoint([out] POINT* pt); HRESULT PutPoint([in] POINT* pt); }; CDialogEx类怎样初始化?怎么没有像CDialog类初始化的OnInitDialog()函数 怎么在原有的基础上扩展申请的内存大小 基于单文档的串口通讯,求教 请教 ·VC按钮变色问题··· 内存不可读错误 VC下的XML解析器 !!!!!!!!!又是一个怪毛病!!!MFC?Access?HELP!!!!!!! 关于指针作为返回值 C#如何将wav文件转换成数字信号 散分庆祝自己可以发200分帖子 请问那里有内存(读写)文章和源码啊? 那位兄弟有GB←→BIG5的源代码或者库,给我一份,急用,谢谢!
Conquer what is not
比如像这样:
interface IPoint : IDispatch
{
[propget, id(1), helpstring("property x")] HRESULT x([out, retval] long *pVal);
[propput, id(1), helpstring("property x")] HRESULT x([in] long newVal);
[propget, id(2), helpstring("property y")] HRESULT y([out, retval] long *pVal);
[propput, id(2), helpstring("property y")] HRESULT y([in] long newVal);
HRESULT GetPoint([out] POINT* pt);
HRESULT PutPoint([in] POINT* pt);
};