G
Guest
This structure definition works! The only difference is that it initializes all the members, which I didn't even know was legal in C#. Any clue why that would make a difference?
[ StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)
class LOGFON
public int lfHeight = 0
public int lfWidth = 0
public int lfEscapement = 0
public int lfOrientation = 0
public int lfWeight = 0
public byte lfItalic = 0
public byte lfUnderline = 0
public byte lfStrikeOut = 0
public byte lfCharSet = 0
public byte lfOutPrecision = 0
public byte lfClipPrecision = 0
public byte lfQuality = 0
public byte lfPitchAndFamily = 0
[ MarshalAs(UnmanagedType.ByValTStr, SizeConst=32) ] public string lfFaceName = null
[ StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)
class LOGFON
public int lfHeight = 0
public int lfWidth = 0
public int lfEscapement = 0
public int lfOrientation = 0
public int lfWeight = 0
public byte lfItalic = 0
public byte lfUnderline = 0
public byte lfStrikeOut = 0
public byte lfCharSet = 0
public byte lfOutPrecision = 0
public byte lfClipPrecision = 0
public byte lfQuality = 0
public byte lfPitchAndFamily = 0
[ MarshalAs(UnmanagedType.ByValTStr, SizeConst=32) ] public string lfFaceName = null