R.Wieser
2024-05-21 18:44:34 UTC
Hello all,
I've just build an OCX for usage within vbscript, and am running into a
problem :
I'm trying to have a method #1 return a SafeArray of type VT_UI1, and later
provide it to a method #2.
The problem is that when I do this :
Object.Method2(Object.Method1())
everything works.
But when I use an intermediate variable like this
Data = Object.Method1()
Object.Method2(Data)
VBScript throws a "Type mismatch" error - and I have no idea why or how to
solve it. :-(
Declarations of both methods in the IDL file :
HRESULT Method1([out, retval] SAFEARRAY(unsigned char)* Result);
HRESULT Method2([in] SAFEARRAY(unsigned char) ByteData);
By the way:
wscript.echo vartype(Object.Method1())
Data = Object.Method1()
wscript.echo vartype(Data)
both of the above return &H2011 (array of VT_UI1)
Help ?
Regards,
Rudy Wieser
I've just build an OCX for usage within vbscript, and am running into a
problem :
I'm trying to have a method #1 return a SafeArray of type VT_UI1, and later
provide it to a method #2.
The problem is that when I do this :
Object.Method2(Object.Method1())
everything works.
But when I use an intermediate variable like this
Data = Object.Method1()
Object.Method2(Data)
VBScript throws a "Type mismatch" error - and I have no idea why or how to
solve it. :-(
Declarations of both methods in the IDL file :
HRESULT Method1([out, retval] SAFEARRAY(unsigned char)* Result);
HRESULT Method2([in] SAFEARRAY(unsigned char) ByteData);
By the way:
wscript.echo vartype(Object.Method1())
Data = Object.Method1()
wscript.echo vartype(Data)
both of the above return &H2011 (array of VT_UI1)
Help ?
Regards,
Rudy Wieser