I have the following code in C++ which I need to be able to call from C#:
struct Inner
{
double data1;
double data2;
};
struct Outer
{
double data3;
SAFEARRAY innerData;
};
int WINAPI ProcessData (Outer& outer )
{
...
}
I tried the following but it did not work What am I doing wrong?
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct Inner
{
public double data1;
public double data2;
}
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct Outer
{
public double data3;
[MarshalAsAttribute(UnmanagedType.Safearray,ArraySubType = UnmanagedType.Struct)]
public Inner[] innerData;
}