I can call C++ methods using byte arrays as values but I wish to call a C++
method using a reference to an empty byte array that is then initiaised to a
set size by the c++ method and populated within the c++ mthod before
returning back to the c# code.
E.g.
c# call
byte[] data;
cpp_method.getData(ref data);
c++ method signature
int getData (System::Byte __gc * __gc * byteArray __gc[])
However this is not allowed.
Can anybody help me in how I need to call a C++ managed method passing a
reference to a byte array that is going to be initialised in the c++ layer.
Thanks
Willy Denoyette [MVP] - 31 Oct 2004 20:49 GMT
Try this:
// CLS compliant function taking a REF array
void GetArray( System::Byte (*bArray) __gc[])
{
*bArray = new System::Byte[123];
}
Willy.
>I can call C++ methods using byte arrays as values but I wish to call a C++
> method using a reference to an empty byte array that is then initiaised to
[quoted text clipped - 20 lines]
>
> Thanks