-
how to pass a array
I had a ATL class,
It has a method,
the method retrieves a array,
for examples:
MyMethod([in] VARIANT myArray)
it can't work
when I create instance follow:
Dim x as Object
Set x = CreateObject("MyObjectID")
Dim a(10)
X.MyMethod a
but it work normally follow:
Dim x as New MyObjectTypeLib.MyObjectID
Dim a(10)
X.MyMethod a
Why?
Who can help me?
Thanks
jiatiejun
-
Re: how to pass a array
Check the type of the variant that is passed in using the first method.
Chances are it is VT_BYREF|VT_VARIANT, so you should "dereference" it
using VariantCopyInd function.