Reputation: 171
I have the following C ++ function and I would make the wrapper function in c #:
byte* FunctionReturnVectorPoint()
{
return vectorPoint;
}
I tried so:
[DllImport("DLL_NAME.dll", CallingConvention = CallingConvention.ThisCall)]
unsafe public static extern byte*[] FunctionReturnVectorPoint();
but it does not work.
You have any suggestions?
Upvotes: 1
Views: 72
Reputation: 171
solved:
[DllImport("DLL_NAME.dll", CallingConvention = CallingConvention.ThisCall)]
public static extern IntPtr FunctionReturnVectorPoint();
and calling the function in this way:
IntPtr tempPoint = FunctionReturnVectorPoint();
byte[] vector= new byte[dimensionVector];
Marshal.Copy(tempPoint , vector, 0, dimensionVector);
Upvotes: 1