I understand that to represent joins in C # I need to use StructLayout [LayoutKind.Explicit)] and [FieldOffset (x)] to indicate the byte offset within the union. However, I have the following union that I want to introduce, and FieldOffset only assigns an offset in byte size.
union _myUnion { unsigned int info; struct { unsigned int flag1:1
As you can see for the internal structure in the union, I cannot use FieldOffset, since I need something that can be compensated a bit.
Is there a solution? I am trying to call a DLL function, and one of the struct data was defined as such, and I had no idea how to best represent this union structure.
source share