Link to home
Start Free TrialLog in
Avatar of jaxrpc
jaxrpc

asked on

Passing managed array to unmanaged function C++

Hi,

how can i pass a managed array of bytes
array<byte> to an unmanaged function

void fillArray(unsigned char ** yrArray);

the function will fill the array.

thanks.
Avatar of jkr
jkr
Flag of Germany image

Take a look at

http://msdn.microsoft.com/en-us/library/9b1fy41s(VS.80).aspx ("How to: Marshal Arrays Using C++ Interop")

and/or

http://msdn.microsoft.com/en-us/library/bd99e6zt.aspx ("How to: Marshal Arrays Using PInvoke")

depending on which method you are using. Both articles come with full sample code.
ASKER CERTIFIED SOLUTION
Avatar of itsmeandnobodyelse
itsmeandnobodyelse
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial