Board index » cppbuilder » Passing variant array from VBScript to CB ActiveX

Passing variant array from VBScript to CB ActiveX

Hello

i have to pass a Variant which holds a array of Variants (=VariantArray)
from VB to my CB ActiveX Control. Using VB or other languages its OK.

In VBScript and WSH i get an Error because WSH passes the variant data "by
reference".
(0x400C) instead a VariantArray (0x200C).

Dim Data(5)
Data(0)=......
call CBActiveX.foo(Data)

How do i declare the foo function in the Type Library Editor to get the
Array passed by Value and not by reference ? I always get a _ASSERT
Error when the ActiveX calls down to the VCL foo.

I declare
OCX: STDMETHODIMP  foo(TVariant data, TOLEBOOL* Value);
VCL:: bool foo(TVariant data);

calldown in OCX :

        *Value = m_VclCtl->foo(VARIANT(data));

Stefan

--
******************************************
* Remove the 3 spamcatcher X from
* my e-mail adress to e-mail me.
******************************************

 

Re:Passing variant array from VBScript to CB ActiveX


I think you should declare the parameter as TVariant and call the
GetBaseVariant method to obtain the actual variant ( basically, perform
the dereferencing ).

Alex

Quote
Stefan Schedel wrote:

[snip]

Other Threads