P
Per Rasmussen
I need to call the function CreateFontIndirect. I have made my header like
this:
private class LOGFONT
{
private int lfHeight;
private int lfWidth;
private int lfEscapement;
private int lfOrientation;
private int lfWeight;
private byte lfItalic;
private byte lfUnderline;
private byte lfStrikeOut;
private byte lfCharSet;
private byte lfOutPrecision;
private byte lfClipPrecision;
private byte lfQuality;
private byte lfPitchAndFamily;
private char[] lfFaceName;
}
[DllImport("coredll.dll")]
private static extern IntPtr CreateFontIndirect(ref LOGFONT lplf);
But when I call the function like this:
LOGFONT lf = new LOGFONT;
... // Setting lf
hfont = CreateFontIndirect(ref lf);
I get a NotSupportedExeption. How should I do it?
this:
private class LOGFONT
{
private int lfHeight;
private int lfWidth;
private int lfEscapement;
private int lfOrientation;
private int lfWeight;
private byte lfItalic;
private byte lfUnderline;
private byte lfStrikeOut;
private byte lfCharSet;
private byte lfOutPrecision;
private byte lfClipPrecision;
private byte lfQuality;
private byte lfPitchAndFamily;
private char[] lfFaceName;
}
[DllImport("coredll.dll")]
private static extern IntPtr CreateFontIndirect(ref LOGFONT lplf);
But when I call the function like this:
LOGFONT lf = new LOGFONT;
... // Setting lf
hfont = CreateFontIndirect(ref lf);
I get a NotSupportedExeption. How should I do it?