'Javascript to ActiveX variable type

ActiveX object method has this signature.

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

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

I'm attempting to call this method from javascript. I've tried many combinations but always get a "Type mismatch" error.

Reference links:

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."



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source