Re: SetTextCharacterExtra

Tech-Archive recommends: Fix windows errors by optimizing your registry



You can reproduce it my creating a new Project. And replacing the
CNewView::OnDraw() with:

void CNewView::OnDraw(CDC* pDC)
{
pDC->SetMapMode(MM_HIMETRIC);
pDC->SetTextCharacterExtra(85);
CRect r;

CString strName="1884-1922"; //does not print '-'
r.SetRect(200,-2000,8000,-3000);
pDC->DrawText(strName,r,DT_CENTER);

strName="ABCDEFG";
r.SetRect(200,-3000,8000,-4000);
pDC->DrawText(strName,r,DT_CENTER);

strName="1884X1922";//the X gets printed over the 4
r.SetRect(200,-4000,8000,-5000);
pDC->DrawText(strName,r,DT_CENTER);

strName="1884 1922";
r.SetRect(200,-5000,8000,-6000);
pDC->DrawText(strName,r,DT_CENTER);

strName="1a2b3c1A2B3C4X";
r.SetRect(200,-6000,8000,-7000);
pDC->DrawText(strName,r,DT_CENTER);
}

Thank you,
Tim


"Alex Blekhman" wrote:

"TOB" wrote:
I think it might be my display driver.
I got the same code to work on some computers and others fail.

This functionality is too basic in order to ascribe the problem to
a display driver bug. Of course, everything is possible, but as a
first step I'd suggest you to reproduce the problem with minimal
standalone application.

Alex



.



Relevant Pages

  • RE: How can I make a vertical CRebar control display a horizontal grip
    ... I write a sample on this issue, but I can not reproduce your issue. ... CRect rectClient; ... a simple test project so that I can reproduce your ... issue and find a resolution? ...
    (microsoft.public.vc.mfc)
  • Re: SetTextCharacterExtra
    ... "Alex Blekhman" wrote: ... I succeeded to reproduce it on my system, ... but these changes apparently fix it: ... pDC->ExtTextOut.x, r.top, 0, r, strName, NULL); ...
    (microsoft.public.vc.language)