Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

Lonnie Johnson

@Lonnie Johnson
About
Posts
8
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • CFontDialog font size - Need Help!!!!!
    L Lonnie Johnson

    I have found the answer. lfHeight must be converted from print units to screen units because the CFontDialog class uses screen units. Here is the updated code:

    ASSERT(pDC->GetMapMode() == MM_TEXT);
    LOGFONT lf;
    ::ZeroMemory(&lf, sizeof(LOGFONT));
    int nPrintDpi = pDC->GetDeviceCaps(LOGPIXELSY);
    lf.lfHeight = -MulDiv(10, pDC->GetDeviceCaps(LOGPIXELSY), 72);

    // Convert lfHeight from print units to screen units
    // because the CFontDialog class uses Screen units
    HDC hDC = GetDC(m_pView->m_hWnd);
    int nScreenDpi = GetDeviceCaps(hDC, LOGPIXELSY);
    lf.lfHeight = MulDiv(lf.lfHeight, nScreenDpi, nPrintDpi);

    lstrcpy(lf.lfFaceName, _T("Arial"));
    CFontDialog dlg(&lf, CF_PRINTERFONTS, pDC);
    if (dlg.DoModal() == IDOK)
    {
    m_strFont = dlg.GetFaceName();
    m_nPointSize = dlg.GetSize() / 10;
    }

    C / C++ / MFC help tutorial question

  • CFontDialog font size - Need Help!!!!!
    L Lonnie Johnson

    In the OnBeginPrinting function of my view class I am displaying a CFontDialog dialog box. I want the default font to be Arial and the default size to be 8. When the dialog box displays, it a shows default size of 50. Here is the code. These are the first lines in the OnBeginPrinting function.

    ASSERT(pDC->GetMapMode() == MM_TEXT);
    LOGFONT lf;
    ::ZeroMemory(&lf, sizeof(LOGFONT));
    lf.lfHeight = -MulDiv(10, pDC->GetDeviceCaps(LOGPIXELSY), 72);
    lstrcpy(lf.lfFaceName, _T("Arial"));
    CFontDialog dlg(&lf, CF_PRINTERFONTS, pDC);
    if (dlg.DoModal() == IDOK)
    {
    m_strFont = dlg.GetFaceName();
    m_nPointSize = dlg.GetSize() / 10;
    }

    The value returned by pDC->GetDeviceCaps(LOGPIXELSY) is 600. The computed value for lf.lfHeight when 8 points is used is -67. The resulting size value in the Select Font dialog is 50. Why is the Select Font dialog displaying as font size of 50 instead of 8? Here are the results from some other point sizes. input dialog box 8 50 10 62 12 75 14 88 20 125 Every example of code I can find looks just like the above. Why is this code not working? Thanks!

    C / C++ / MFC help tutorial question

  • CFontDialog incorrect default size
    L Lonnie Johnson

    The value returned by pDC->GetDeviceCaps(LOGPIXELSY) is 600. The computed value for lf.lfHeight when 8 points is used is -67. The resulting size value in the Select Font dialog is 50.

    C / C++ / MFC question

  • CFontDialog incorrect default size
    L Lonnie Johnson

    Here are the results from some other point sizes. input point size size that appears in the dialog box. 8 50 12 62 14 88 16 100 18 113 20 125

    C / C++ / MFC question

  • CFontDialog incorrect default size
    L Lonnie Johnson

    In the OnBeginPrinting function of my view class I am displaying a CFontDialog dialog box. I want the default font to be Arial and the default size to be 10. When the dialog box displays, it a shows default size of 62. Here is the code. These are the first lines in the OnBeginPrinting function.

    ASSERT(pDC->GetMapMode() == MM_TEXT);
    LOGFONT lf;
    ::ZeroMemory(&lf, sizeof(LOGFONT));
    lf.lfHeight = -MulDiv(10, pDC->GetDeviceCaps(LOGPIXELSY), 72);
    lstrcpy(lf.lfFaceName, _T("Arial"));
    CFontDialog dlg&lf, CF_PRINTERFONTS, pDC);
    if (dlg.DoModal() == IDOK)
    {
    m_strFont = dlg.GetFaceName();
    m_nPointSize = dlg.GetSize() / 10;
    }

    Why is the dialog displaying the wrong size value?

    C / C++ / MFC question

  • GetIDsOfNames returns E_ACCESSDENIED after installing SP2 on Windows XP Pro
    L Lonnie Johnson

    Hello Sohail, Thank you very much for the response. I looked at the link in you message and also the links on that page. I think there is something that I did not make clear. My BHO runs on Windows XP Pro SP 2. There is just one facility of the BHO that does not work. I have added items to the IE tools menu and buttons to the IE toolbar. These menu items and toolbar buttons do no work on Windows XP Pro SP 2. Everything else in my BHO is working. The BHO can be used without the menu items and buttons, but it is much more convenient to have them. These items fail because they require the GetIDsOfName function. So, the links you provided did clear up some things for me, the did not help me find a resolution to my problem. Someone must know what causes E_ACCESSDENIED to be returned from GetIDsOfNames. Lonnie

    COM sharepoint question

  • GetIDsOfNames returns E_ACCESSDENIED after installing SP2 on Windows XP Pro
    L Lonnie Johnson

    I have search all over MSDN and really can not find anything that indicates the behavior has changed. However in my search there were links to IDispatch::GetIDsOfNames in the SDK and none the the links work. (http://msdn.microsoft.com/library/en-us/automat/htm/chap5_32cz.asp[^] )They all come up with page not found. Lonnie

    COM sharepoint question

  • GetIDsOfNames returns E_ACCESSDENIED after installing SP2 on Windows XP Pro
    L Lonnie Johnson

    I have written a BHO application. This application works on Windows XP Home, Windows 2000 Pro and Windows XP Pro without SP 2 installed. After SP 2 was installed on Windows XP Pro the GetIDsOfNames function started failing with E_ACCESSDENIED (0x80070005). The GetIDsOfNames work succesfully one time and fails after that. What does E_ACCESSDENIED mean when returned by GetIDsOfNames? Why did SP 2 on Windows XP Pro cause this to start happening?

    COM sharepoint question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups