Article ID: 173249
Article Last Modified on 11/21/2006
void CFntWidthView::OnDraw(CDC* pDC)
{
pDC->SetMapMode(MM_LOENGLISH);
LOGFONT lfFont;
CFont fontNew, *fontOld;
ZeroMemory(&lfFont, sizeof(lfFont));
lstrcpy(lfFont.lfFaceName, "Arial");
lfFont.lfWidth = 10;
lfFont.lfHeight = 50;
fontNew.CreateFontIndirect(&lfFont);
fontOld = pDC->SelectObject(&fontNew);
pDC->TextOut(0, -100, "Font Width lfWidth = 10.", 24);
pDC->SelectObject(fontOld);
}
#include "afxpriv.h"
void AFXAPI AfxDeleteObject(HGDIOBJ* pObject);
logFont.lfWidth = 0;To:
logFont.lfWidth = tm.tmAveCharWidth;
Keywords: kbbug kbdocview kbfix kbnoupdate kbuidesign kbvc600fix KB173249