Search code examples
javascriptdllactivexopos

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


Solution

  • Given all the references I've put in the question, the current conclusion is that it is impossible to call that function directly from Javascript.

    However the possibility of an alternative method (COM proxy/wrapper) might be possible.