1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

ChooseFont dialog not displaying sample font

Discussion in 'MFC' started by Epic720, May 16, 2008.

  1. Epic720

    Epic720 New Member

    Joined:
    May 16, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I am having a bit of trouble figuring this one out. I have copied several code snippets that work perfectly, yet my program does not. I have included libraries that the other programs had, but still nothing.

    When the choose font dialog pops, it is not displaying the sample font in the sample font static control.

    Here is the code snippet I am using:
    Code:
    CHOOSEFONT cf ;
    
    cf.lStructSize = sizeof (CHOOSEFONT) ;
    cf.hwndOwner = hWndDlg ;
    cf.hDC = NULL ;
    cf.lpLogFont = &logfont ;
    cf.iPointSize = 0 ;
    cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS |
    CF_EFFECTS ;
    cf.rgbColors = 0 ;
    cf.lCustData = 0 ;
    cf.lpfnHook = NULL ;
    cf.lpTemplateName = NULL ;
    cf.hInstance = NULL ;
    cf.lpszStyle = NULL ;
    cf.nFontType = 0 ; // Returned from ChooseFont
    cf.nSizeMin = 0 ;
    cf.nSizeMax = 0 ;
    
    ChooseFont (&cf);
    
    I am programming in c++ with VS2005 under vista32.

    Any insight would be appreciated.
     
    Last edited by a moderator: May 17, 2008

Share This Page