Help to convert C++ 6.0 code to C#

L

LPO

Hi,

What the solution to convert this code, please ?
Thank's a lot for response

LPO

SAFEARRAYBOUND sabIn[1];
SAFEARRAY *psaInParms= NULL;
sabIn[0].cElements= 4;
sabIn[0].lLbound= 0;
psaInParms= ::SafeArrayCreate(VT_VARIANT, 1, sabIn);

SAFEARRAYBOUND sabOut[1];
SAFEARRAY *psaOutParms= NULL;
sabOut[0].cElements= 4;
sabOut[0].lLbound= 0;
psaOutParms= ::SafeArrayCreate(VT_VARIANT, 1, sabOut);

VARIANT vInParms;
::VariantInit(&vInParms);
VARIANT vOutParms;
::VariantInit(&vOutParms);

V_VT(&vInParms)= VT_ARRAY | VT_BYREF | VT_VARIANT;
V_VT(&vOutParms)= VT_ARRAY | VT_BYREF | VT_VARIANT;

V_ARRAYREF(&vInParms)= &psaInParms;
V_ARRAYREF(&vOutParms)= &psaOutParms;

::putBSTRElement(psaInParms, 0, CComBSTR(L"")); // D: Returning Status
::putBSTRElement(psaInParms, 1, ConvertStringToBSTR(szXmlInput)); // I:
 
G

Guest

C# and C++ are completly different languages, so there is no way to just convert the code
All this code does is pass a SAFEARRAY to a function.
I'm not sure how a SAFEARRAY is defined in C#, but I think its just a object[0]
The VARIANT's declared aren't being used, but C#'s object type should understand a COM Variant
Mar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top