C# pinvoke structs with union and arrays
问题 im failing to define the correct C# code to work with a C++ library which defines a complex struct with union and arrays, i keep getting some memory exception while executing the C++ code, and im pretty sure its due to this. The c++ struct is as follows, ignoring enums and other struct definition (i will post them if needed but they are pretty extense) typedef struct { DG_CCTALK_APP_EVT_CODE eEventCode; DG_CCTALK_APP_EVT_TYPE eEventType; int iTime; int iHandle; unsigned char uchAddress; DG