S
Steven Blair
I have some C++ code which creates a SafeArray and passes it to my C#
dll using COM:
SAFEARRAY *psaOut = SafeArrayCreateVector(VT_BSTR, 0, 3);
VARIANT pVarOut;
VariantInit(&pVarOut);
pVarOut.vt = VT_ARRAY | VT_BSTR;
pVarOut.parray = psaOut;
InvokeHelper(DispId, DISPATCH_METHOD, VT_I4, (void*)&result, parms,
&pVarIn, &pVarOut);
My C# code can see this fine. However, if I change an element of the
array, it isnt reflected when I return.
My question is, is my C# method signature the problem:
[Out,MarshalAs(UnmanagedType.SafeArray, SafeArraySubType =
VarEnum.VT_BSTR)] ref String[] OutputArray
I assume this is the correct signature for what I need to do, since I
can access the array with no problems.
Might be a tricky one, but any help would be appreciated.
Steven
dll using COM:
SAFEARRAY *psaOut = SafeArrayCreateVector(VT_BSTR, 0, 3);
VARIANT pVarOut;
VariantInit(&pVarOut);
pVarOut.vt = VT_ARRAY | VT_BSTR;
pVarOut.parray = psaOut;
InvokeHelper(DispId, DISPATCH_METHOD, VT_I4, (void*)&result, parms,
&pVarIn, &pVarOut);
My C# code can see this fine. However, if I change an element of the
array, it isnt reflected when I return.
My question is, is my C# method signature the problem:
[Out,MarshalAs(UnmanagedType.SafeArray, SafeArraySubType =
VarEnum.VT_BSTR)] ref String[] OutputArray
I assume this is the correct signature for what I need to do, since I
can access the array with no problems.
Might be a tricky one, but any help would be appreciated.
Steven