I have a problem passing a argument to a method on a third-party activex object in an Axapta form.

 

The prototype of the method is something like (using Visual Studio OLE/COM Object Viewer):

 

read(BSTR* szData)

 

or in the ActiveX explorer in Axapta:

 

read(COMVariant /*bstr*/ _szData)

 

 

In VB it can be called this way:

 

Dim sResult As String

Activex.read(sResult)

 

I suppose I should pass a COMVariant object as a parameter, but how should it be initialised.

I have tried:

 

COMVariant argument = new COMVariant(COMVariantInOut::out_retval,COMVariantType::VT_BSTR);

Activex.read(argument);

 

But It throws a type mismatch exception.

 

Can anybody tell me the right way to initialize the COMVariant object or give me another solution??

 

Regards

Thomas Jensen

 

 



Yahoo! Groups Links

Reply via email to