Javascript 到 ActiveX 变量类型

标签 javascript dll activex opos

ActiveX 对象方法具有此签名。

long DirectIO(long Command, long* pData, BSTR* pString)

Int32 DirectIO(Int32, Int32 ByRef, System.String ByRef)

我正在尝试从 javascript 调用此方法。我尝试了多种组合,但总是收到“类型不匹配”错误。

引用链接:

So why does VBScript produce a type mismatch error here? VBScript doesn't! The object produces the type mismatch error, which VBScript dutifully reports. The object's implementation of Invoke calls the default implementation of Invoke provided for you by the type library implementation. That thing says "I've got a reference to a variant, and that variant is a string. I need a reference to a string. That's a type mismatch."

最佳答案

鉴于我在问题中提供的所有引用资料,当前的结论是不可能直接从 Javascript 调用该函数。

但是,可能存在替代方法(COM 代理/包装器)。

关于Javascript 到 ActiveX 变量类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1429737/

相关文章:

javascript - 使用脚本创建的元素看起来不同

javascript - 在文档中间刷新时,jQuery 高度错误

c - Python Ctypes OSError : exception: access violation reading 0x00000000

cross-browser - 替换跨浏览器中的 ActiveX 控件

c++ - 将 QAxWidget 添加到空项目时出现链接器错误

javascript - 下载文件然后离开页面

JavaScript Date.toString() 基数参数错误

C# - 动态加载 DLL - System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types

c++ - 如何在 C++ 中创建动态 DLL 库,以替代遗留的 Fortran DLL

delphi - 如何判断CoInitialize被调用了多少层?