Error as like this-->object field at offset 75 that is incorrectly aligned or overlapped by a non-object field. But here size constant is 3 so I think after 72 offset will be 75..If I change the offset to 76 it will works fine. I think reason is that size of int is 4. After changing that code will be like this.
But at that time I got the error as object field at offset 107 that is incorrectly aligned or overlapped by a non-object field..Can anyone tell me what is the main reason behind this..
Thanks..
Code:
[FieldOffset(72)]
[MarshalAs(UnmanagedType.ByValArray,SizeConst= 3)]
public int[] DC;
[FieldOffset(76)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public float[] WIN;
[FieldOffset(84)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[] name;
[FieldOffset(104)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] SET;
[FieldOffset(107)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)]
public byte[] ID;
Thanks..