Parameter for CE ActiveX Method

Parameter for CE ActiveX Method

Post by Jim Lov » Fri, 03 Aug 2001 08:58:11



I am trying to use an array for a parameter for my CE ActiveX control
written in Embedded C++. The C++ method looks like:
short myMethod(short FAR* myParam)
{
    /*use myParam like an array*/
Quote:}

this compiles just fine.( It also works just fine on the desktop version of
the control and desktop VB app)

In embeddedVB I try do this:
Dim x As Integer
Dim arrItems(1) As Integer
arrItems(0) = 100
arrItems(1) = 200
'this fails
x = ctrl.myMethod(arrItems(0))''this works on desktop version
'this fails
x = ctrl.myMethod(arrItems())
'this also fails
x = ctrl.myMethod(arrItems)

It fails with a type mismatch.
Any ideas? Thanks in advance.

 
 
 

Parameter for CE ActiveX Method

Post by Terry Myhre » Fri, 03 Aug 2001 23:40:42


you need to use a SafeArray of Variants to be accessible from eVB.

-Terry


Quote:> I am trying to use an array for a parameter for my CE ActiveX control
> written in Embedded C++. The C++ method looks like:
> short myMethod(short FAR* myParam)
> {
>     /*use myParam like an array*/
> }
> this compiles just fine.( It also works just fine on the desktop version
of
> the control and desktop VB app)

> In embeddedVB I try do this:
> Dim x As Integer
> Dim arrItems(1) As Integer
> arrItems(0) = 100
> arrItems(1) = 200
> 'this fails
> x = ctrl.myMethod(arrItems(0))''this works on desktop version
> 'this fails
> x = ctrl.myMethod(arrItems())
> 'this also fails
> x = ctrl.myMethod(arrItems)

> It fails with a type mismatch.
> Any ideas? Thanks in advance.