Hi,
What wrong with my struct declaration ?
When I run my program, I got a TypeLoadException.
Thanks
What wrong with my struct declaration ?
When I run my program, I got a TypeLoadException.
Code:
[StructLayout(LayoutKind.Explicit, CharSet=CharSet.Ansi, Size=16)]
struct InfoRegister
{
[FieldOffset(0)]
public uint TargetIdBitField;
[FieldOffset(4)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 9) ]
public byte[] Label;
[FieldOffset(13)]
public byte Mode;
[FieldOffset(14)]
public byte Index;
[FieldOffset(15)]
public byte CS;
[FieldOffset(0)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16) ]
public ushort[] StructInUShortArray;
}
Thanks