Hi.
I have struct in C++:
struct MY_STRUCT
{
int x;
int y;
char** arrNames; //array of strings
}
I have function GetMyStruct, which gives me pointer to this struct, but
I can't get the array of strings (MY_STRUCT.arrN ames).
MY_STRUCT* GetMyStruct();
In C# :
public struct MY_STRUCT
{
public int x;
public int y;
public string[] arrNames; //array of strings
}
public class MyWrapper
{
[DllImport("MyDl l.dll")]
private static extern IntPtr GetMyStruct();
public static MY_STRUCT GetMyStructW()
{
IntPtr p = GetMyStruct();
return (MY_STRUCT) Marshal.PtrToSt ructure(p, typeof(MY_STRUC T));
}
}
BUT MyWrapper.GetMy StructW() doesn't work. Plllease help.