???? ID: 145994 - ????? ???????: 02 ?????? 2010 - ??????: 3.0

????? ????? ??????? ?? ???? ?? ??????? ????? C++ ??? ????? ?? ???? ???? ????

?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
???:Microsoft Visual C++ .NET (2002) Microsoft .NET Framework ?????? ??? ?? ??? ?? ???????? ???? ?? ????????? ??? Microsoft Windows ??? ???? ?? ?????? ???? ??? ?? ???? ??? ?? ?? ??????? ???? ????????? ????? C++ ??? ?? ??? ???? ???? ???

?? ????? ??

??? ?? ??????? ???? | ??? ?? ??????? ????

??????

GetDialogBaseUnits() ????? ????? ?????? ????? ?? ????? ??????? ?? ??? ?? ?????? ?? ??? ??? ??? ?? ?????? ????? ?? ????? ??? ?? ????? ????? ?? ??? ???, ????? ??? ???? ?? ???? ?? ???? ????? ????? ?? ??? ??? ??? ?? ???? ?? ???????? ?? ?????? ????? ????? ??????? ?? ???? ?? ??????? ????? ?? ?????? ???? ?? ??? ????? ?? ???? ????

???? ???????

??????? ???? ???? ?????? ????? ??? ?????? ?? (??????? ???) ?? ??? ????? ?? ????? ??? GetDialogBaseUnits() ?? ??? ??? ??????? ??? ??????? ?? ?????? ?? ??? ????? ??? ??:
pixelX = (dialogunitX * baseunitX) / 4
pixelY = (dialogunitY * baseunitY) / 8
				

???????, ??? ?? ?????? ????? ?? ????? ?? ???? ???, ?? ???? ??? ???????????? ??????? ???? ?? ??? ??? ???????? ?????? ???? ?? ???? ???? ?? ??????? ???:

?? ????

?????? ????? ????? ???? ???? ????? ?? ?????? ??? ??????? ????? ????? ???? ????? ????? ??? ????? ?? ??? ???? ?? ????? ?? ?????? ??? ??? ???? ?? ????? ??????? ???? ??? ?? ??? ??? ???? ?????? ?????? ??????? ?? ??? ?? ?????? ?? ??????? tmAveCharWidth precise ???? ??? ?? ??? ?? ????? ????:
   void CAboutDlg::OnPaint()
   {
       CPaintDC dc(this); // device context for painting

       CFont* pFont = GetFont();
       CFont* oldFont = dc.SelectObject(pFont);
       TEXTMETRIC tm;
       dc.GetTextMetrics( &tm );
       int baseUnitY = tm.tmHeight;
       CSize size;
       size = dc.GetTextExtent(
           "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 52);
       int baseUnitX = (size.cx / 26 + 1) / 2;
       TRACE("baseUnitX = %d\n", baseUnitX);
       TRACE("baseUnitY = %d\n", baseUnitY);
       dc.SelectObject(oldFont);

   }
				

?? ????

?????? ?? ???? ??? ??? ?????????? x ?? ??? MapDialogRect() ?? ????? ???? = 4, y = 8 ?????? ????? ????? ???? ??????? ????? ????? ??? ????? ?? ????? ??? ??, ??????? ????????? ??? ?????????? ???? ???? ?????? ????? ????? ???? ??????? ?? ????? ??? ?????? ???????????? ?? ???? ?? ????? ????? ??????? ??? ?????? ???? ?? ??? ???? MapDialogRect() ????? ???? ?? ???? ??? ????? ????? ??? ?? ???? ???? ????? ???? ?? ???? ??????? ????? ????? ???? ??????? ?? ?????? ??:
   void CAboutDlg::OnPaint()
   {
       CPaintDC dc(this); // device context for painting

       CRect rc( 0, 0, 4, 8 );

       MapDialogRect( &rc );
       int baseUnitY = rc.bottom;
       int baseUnitX = rc.right;
       TRACE("baseUnitX = %d\n", baseUnitX);
       TRACE("baseUnitY = %d\n", baseUnitY);

   }
				

??????

???????? ??????? ?? ???, ????? ????? ???? ?? Microsoft ???????? ??? ?????:
125681  (http://support.microsoft.com/kb/125681/EN-US/ ) ???-??????-?????? ????? ?? ??? ????? ???? ???? ?? ???? ???? ????

???? ???? ???? ??:
  • Microsoft Foundation Class Library 4.2, ?? ???? ??? ?????? ???? ???:
    • Microsoft Visual C++ 1.5 Professional Edition
    • Microsoft Visual C++ 4.2 Enterprise Edition
    • Microsoft Visual C++ 5.0 Enterprise Edition
    • Microsoft Visual C++ 6.01 Professional Edition
    • Microsoft Visual C++ 4.0 Professional Edition
    • Microsoft Visual C++ 4.1 Subscription
    • Microsoft Visual C++ 5.0 Professional Edition
    • Microsoft Visual C++ .NET 2002 Standard Edition
    • Microsoft Visual C++ .NET 2003 Standard Edition
??????: 
kbinfo kbcode kbdlg kbfont kbhowto kbuidesign kbmt KB145994 KbMthi
???? ?????? ???????????? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:145994  (http://support.microsoft.com/kb/145994/en-us/ )