I need your help.
I am trying to import a C Dll into a C# project. While doing that, I need pass a struct between the Dll and C# project in both directions.
Here is C definition:
struct mwBITMAP
{
int bmWidth;
int bmHeight;
BYTE* bmData;
};
Here is C# definition:
[StructLayout(LayoutKind.Sequential)]
public struct MwRemoteBmp
{
public int Width;
public int Height;
public byte[] Data;
}
I tried to pass the a struct (the Data is well initialized) from C# to a dll's test function by reference. The width and height are both right. But the Data is all wrong.
Where did I make mistakes?