-----Original Message-----
Of course I can give you all the information you need to
help me (thank you in advance).
This is the code snippet where my application fails:
----------------------------------------
private byte[] createLogicFont(byte sizeLetter)
{
ArrayList logfont = new ArrayList();
logfont.Add ((byte)sizeLetter);//Height
logfont.Add ((byte)0);
logfont.Add ((byte)0);
logfont.Add ((byte)0);
logfont.Add ((byte)0); //Width
logfont.Add ((byte)0);
logfont.Add ((byte)0);
logfont.Add ((byte)0);
logfont.Add ((byte)132); //lfEscapement Rotation
(900) 90º
logfont.Add ((byte)3);
logfont.Add ((byte)0);
logfont.Add ((byte)0);
logfont.Add ((byte)132); //lfOrientation Rotation
(900) 90º
logfont.Add ((byte)3);
logfont.Add ((byte)0);
logfont.Add ((byte)0);
logfont.Add ((byte)145);//lfWeight 400 Normal
logfont.Add ((byte)1); //3
logfont.Add ((byte)0);
logfont.Add ((byte)0);
logfont.Add ((byte)0); //lfItalic 0 false
logfont.Add ((byte)0); //lfUnderline 0 false
logfont.Add ((byte)0); //lfStrikeOut 0 false
logfont.Add ((byte)0); //
logfont.Add ((byte)255);//lfCharSet 255
logfont.Add ((byte)0);//lfOutPrecision 0
logfont.Add ((byte)0);//fClipPrecision 0
logfont.Add ((byte)0);//lfQuality 0
logfont.Add ((byte)0); //lfPitchAndFamily 0
//lfFaceName
logfont.Add ((byte)67); //C
logfont.Add ((byte)111); //o
logfont.Add ((byte)117); //u
logfont.Add ((byte)114); //r
logfont.Add ((byte)105); //i
logfont.Add ((byte)101); //e
logfont.Add ((byte)114); //r
logfont.Add ((byte)0);
byte[] exit= (byte[])logfont.ToArray(typeof
(byte));
return exit;
}
private void changefont(IntPtr hdc,byte sizefont)
{
byte[] LogicFont = createLogicFont(sizefont);
IntPtr font = CreateFontIndirect(LogicFont);
try {
SelectObject(hdc,font);
} catch (Exception e) {
MessageBox.Show (e.ToString ());
MessageBox.Show (e.Message );
}
}
----------------------------------------
The function "changefont" contains the "SelectObject"
call that fails. I checked (debugging) that before that
call, the handle "hdc" and the "font" are valid.
Thank you very much for your interest.
-----Original Message-----
Could you give us some more information. What are you trying to do? Do you
have a code snippet? The information you are giving now is not enough to
help you further.
--
Regards,
Maarten Struys, eMVP
PTS Software bv
message news:
[email protected]...
.
.