ActiveX: Correct datatypes in VB.NET

cadology

New member
Joined
Sep 22, 2003
Messages
1
I have a ActiveX control being used in .NET but Im not getting the correct datatype through for one of the methods. In VB6, use the code:
Dim Data(0 to 1) as Variant
Data(0) = "Test"
Data(1) = CDbl( 123.456 )
Dim pVar1 as Variant
pVar1 = Data
SetXdata( pVAr1 )

This works good as the data in coming through the ActiveX interface as a pointer to a variant array(VT_PTR | VT_VARIANT )

I cant seem to get this working in VB.NET, I have written
Dim Data(1) as Object
Data(0) = "Test"
Data(1) = CDbl( 123.456 )
Dim pVar1 as Object
pVar1 = Data
SetXdata( pVAr1 )
but I get a data type mismatch error because the variable pVar1 is being passed as (VT_BYREF | VT_ARRAY | VT_VARIANT).

Question: How in VB.NET do I get the data type using Object to be (VT_PTR | VT_VARIANT ) ?

TIA
 
Back
Top