I have a dll that is expecting a 3x3 array which I'm am using DllImport to access. In addition, this array is located in a struct that is getting passed. I'm having problems that I think are located somewhere in how I'm marshaling it. Any input would be appreciated.
(examples are shortened for clarity, let me know if something more complete would be useful
/*C code*
typedef float RotMtxType[3][3]
typedef struct
double ccNum
RotMtxType ccuGCCtoLNEDrot Mtx;
extern int ccuInitStateStr ucture
CCUStateStruct *ccuStatePtr)
//C# Cod
[StructLayout(La youtKind.Sequen tial)
public struct CCUStateStruc
public double ccNum
[MarshalAs(Unman agedType.ByValA rray, SizeConst=9
public float [,] ccuGCCtoLNEDDro tMtx
elsewhere ..
ccuState.ccuGCC toLNEDDrotMtx = new float[3,3
...
[DllImport("CCU. dll")
public extern static int ccuInitStateStr ucture
[MarshalAs(Unman agedType.Struct )]ref CCUStateStruct ccuStatePtr)
I then get the error
Additional information: Can not marshal field ccuGCCtoLNEDrot Mtx of type CCUStateStruct: This type can not be marshaled as a structure field
Thanks much
To