-
July 7th, 2014, 03:27 AM
#1
PInvoke a C++ unsigned char [][] to C#?
The C++ structure like that:
typedef struct d_setting
{
unsigned short setting1;
unsigned char name[100][200];
}D_SETTING;
typedef struct d_config
{
unsigned short data;
D_SETTING setting;
}D_CONFIG;
And i tried to call the C++ function by creating the corresponding structure in C# like:
[StructLayout(LayoutKind.Sequential)]
public struct D_SETTING
{
public ushort setting1;
public byte[][] name;
}
[StructLayout(LayoutKind.Sequential)]
public struct D_CONFIG
{
public ushort data;
public D_SETTING setting;
}
But the name is not correct, the program crash..
How could i create the structure for unsigned char[][] in C++??
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|