Click here to Skip to main content
15,915,603 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString, not CStdioFile Pin
Ravi Bhavnani19-May-02 17:35
professionalRavi Bhavnani19-May-02 17:35 
GeneralBlackJack Pin
nywebhead19-May-02 5:44
nywebhead19-May-02 5:44 
GeneralRe: BlackJack Pin
Paul M Watt19-May-02 6:17
mentorPaul M Watt19-May-02 6:17 
GeneralRe: BlackJack Pin
Mazdak19-May-02 8:07
Mazdak19-May-02 8:07 
GeneralRe: BlackJack Pin
Paul M Watt19-May-02 8:37
mentorPaul M Watt19-May-02 8:37 
GeneralRe: BlackJack Pin
Mazdak19-May-02 9:09
Mazdak19-May-02 9:09 
GeneralRe: BlackJack Pin
nywebhead19-May-02 12:24
nywebhead19-May-02 12:24 
GeneralWindow Font Pin
Levon19-May-02 3:53
Levon19-May-02 3:53 
Hi All!

I'm trying to SetFont to CWnd-derived class, but it has no effect.
I'm using member variable in my class - CFont m_font.
In my OnCreate method:

LOGFONT lf; // Used to create the CFont.

memset(&lf, 0, sizeof(LOGFONT));// Clear out structure.
lf.lfHeight = 20; // Request a 20-pixel-high font
strcpy(lf.lfFaceName, "Arial"); // with face name "Arial".
m_font.CreateFontIndirect(&lf); // Create the font.

SetFont(&m_font);
CFont *pFont = GetFont();

pFont is NULL!!! Confused | :confused:
I'm sure that font object (m_font member) remains valid, so that is not the reason.

I even tried to SetFont to child windows of this window (e.g Button or Static control)

m_wndChild.CreateEx(0, _T("Button"), m_csText, WS_CHILDWINDOW | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON, rctChild, pParent, 0x1234);

m_wndChild.SetFont(&(pParent->m_font));

No effect...Confused | :confused: Frown | :(

Can anybody tell me what's wrong?
Thank you

Levon Hayrapetyan,
Student
Yerevan State University
GeneralRe: Window Font Pin
19-May-02 5:05
suss19-May-02 5:05 
GeneralRe: Window Font Pin
19-May-02 5:11
suss19-May-02 5:11 
GeneralRe: Window Font Pin
19-May-02 5:11
suss19-May-02 5:11 
GeneralActiveX Pin
Tzoockee19-May-02 3:43
Tzoockee19-May-02 3:43 
GeneralRe: ActiveX Pin
Bill Wilson20-May-02 8:55
Bill Wilson20-May-02 8:55 
GeneralGet Dialog from View Pin
tongc19-May-02 3:00
tongc19-May-02 3:00 
GeneralRe: Get Dialog from View Pin
Ravi Bhavnani19-May-02 3:37
professionalRavi Bhavnani19-May-02 3:37 
GeneralStupid question about printing Pin
HenrikO19-May-02 1:33
HenrikO19-May-02 1:33 
GeneralRe: Stupid question about printing Pin
19-May-02 3:40
suss19-May-02 3:40 
GeneralRe: Stupid question about printing Pin
HenrikO19-May-02 6:20
HenrikO19-May-02 6:20 
GeneralSee-Through GroupBox Pin
Sara Burns18-May-02 23:08
Sara Burns18-May-02 23:08 
GeneralRe: See-Through GroupBox Pin
Nish Nishant18-May-02 23:10
sitebuilderNish Nishant18-May-02 23:10 
GeneralPassing 2-D array in function Pin
oRion18-May-02 21:01
oRion18-May-02 21:01 
GeneralRe: Passing 2-D array in function Pin
Nish Nishant18-May-02 21:28
sitebuilderNish Nishant18-May-02 21:28 
GeneralRe: Passing 2-D array in function Pin
Aizik Yair18-May-02 22:38
Aizik Yair18-May-02 22:38 
GeneralRe: Passing 2-D array in function Pin
squizz19-May-02 2:52
squizz19-May-02 2:52 
GeneralRe: Passing 2-D array in function Pin
Alexandru Savescu19-May-02 7:27
Alexandru Savescu19-May-02 7:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.