CFont problem...
-
Hi! I'm trying to use two diferent CFont objects to use in diferente CStatics, but one of them is never used, why does this happends, i did like : void CUnits_Sold::OnInitialUpdate() { CFormView::OnInitialUpdate(); //trata das fontes para os títulos CFont hFont; CFont hFontForm; hFont.CreateFont(40, 15, 0, 0, FW_BOLD ,FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "MSTrebuchet"); m_stCStatic.SetFont(&hFont); m_stCLabel.SetFont(&hFont); m_stCMachineName.SetFont(&hFont); m_stCTempo.SetFont(&hFont); m_stCTempo2.SetFont(&hFont); //cria a fonte para as letras de identificação do form hFontForm.CreateFont(200, 14, 0, 0, 0 ,FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "MSTrebuchet"); m_stCFormName.SetFont(&hFontForm); } This hfontform is not used and the m_stCFormName uses the hFont, what am I doing wrong? Thank you for your time Rui
-
Hi! I'm trying to use two diferent CFont objects to use in diferente CStatics, but one of them is never used, why does this happends, i did like : void CUnits_Sold::OnInitialUpdate() { CFormView::OnInitialUpdate(); //trata das fontes para os títulos CFont hFont; CFont hFontForm; hFont.CreateFont(40, 15, 0, 0, FW_BOLD ,FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "MSTrebuchet"); m_stCStatic.SetFont(&hFont); m_stCLabel.SetFont(&hFont); m_stCMachineName.SetFont(&hFont); m_stCTempo.SetFont(&hFont); m_stCTempo2.SetFont(&hFont); //cria a fonte para as letras de identificação do form hFontForm.CreateFont(200, 14, 0, 0, 0 ,FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "MSTrebuchet"); m_stCFormName.SetFont(&hFontForm); } This hfontform is not used and the m_stCFormName uses the hFont, what am I doing wrong? Thank you for your time Rui
As soon as the CFont objects go out of scope, they are destructed. The CFont destructor destroys the GDI font objects. Make the CFont variables members of the view class. --Mike-- "Adventure. Excitement. A Jedi craves not these things." -- Silent Bob 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm
-
As soon as the CFont objects go out of scope, they are destructed. The CFont destructor destroys the GDI font objects. Make the CFont variables members of the view class. --Mike-- "Adventure. Excitement. A Jedi craves not these things." -- Silent Bob 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm