So I have cpp struct that look like this:
Code:
typedef struct TESTSTRUCT {
int Something;
int SomethingElse;
struct TESTSTRUCT *Test;
};
And I need to marshal it to my c# app. So far I came with this:
Code:
[StructLayout( LayoutKind.Sequential )]
public struct TestStruct {
public int Something;
public int SomethingElse;
public IntPtr Test;
}
This works, however its imo very bad solution, because I need to run through everything and marshal it manually. Is there any way to automatically marshal whole struct?