I’m using an unmanaged DLL wartime in C that exports the function:
Code:
void Get (BYTE** pByte);


This function fills the pByte with a BYTE buffer that is allocated inside the unmanaged DLL.


How do I use this function from a C# code?


I tried:
Code:
 
[DllImport("Unmanged.dll")]
public static extern void Get(out byte[] frame);


and

Code:
 
byte [] myByteArray = null ;
UnmangedDLL.Get(out myByteArray);

The trouble was that myByteArray returned with size of 1 while the unmanaged DLL set it to point byte array of 100 bytes.