Click here to Skip to main content
16,005,826 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to remove a handle HFONT from memory? Pin
Daed11-Dec-02 0:00
Daed11-Dec-02 0:00 
AnswerRe: How to remove a handle HFONT from memory? Pin
Gert Boddaert11-Dec-02 0:25
Gert Boddaert11-Dec-02 0:25 
AnswerRe: How to remove a handle HFONT from memory? Pin
Ted Ferenc11-Dec-02 0:34
Ted Ferenc11-Dec-02 0:34 
AnswerRe: How to remove a handle HFONT from memory? Pin
Daed11-Dec-02 2:58
Daed11-Dec-02 2:58 
GeneralRe: How to remove a handle HFONT from memory? Pin
Ted Ferenc11-Dec-02 5:11
Ted Ferenc11-Dec-02 5:11 
GeneralRe: How to remove a handle HFONT from memory? Pin
Ted Ferenc11-Dec-02 5:13
Ted Ferenc11-Dec-02 5:13 
GeneralRe: How to remove a handle HFONT from memory? Pin
Daed11-Dec-02 6:04
Daed11-Dec-02 6:04 
GeneralRe: How to remove a handle HFONT from memory? Pin
Ted Ferenc11-Dec-02 6:27
Ted Ferenc11-Dec-02 6:27 
If is difficult to answer your question, without seeing the code. I assume you are failing to delete a font you have created? You could have called CreateFont twice, thereby overwritting the previous font value?

Assuming, again, it is all in one class.

Constructor
m_hFont = NULL

CreatingFont
if(m_hFont)
DeleteObject(m_hFont)
m_hFont = NULL;
m_hFont = CreateFont(

Destructor
if(m_hFont)
DeleteObject(m_hFont)

This way you are only using m_hFont, so it is easier to check what you are doing. Also check the error returns from the functions.
GeneralProfiling Tools Pin
Steve Thresher11-Dec-02 0:00
Steve Thresher11-Dec-02 0:00 
GeneralRe: Profiling Tools Pin
Andreas Saurwein11-Dec-02 2:09
Andreas Saurwein11-Dec-02 2:09 
GeneralSocket Program Problem!!! Pin
John Bosko10-Dec-02 23:10
John Bosko10-Dec-02 23:10 
GeneralRe: Socket Program Problem!!! Pin
jhwurmbach10-Dec-02 23:42
jhwurmbach10-Dec-02 23:42 
GeneralRe: Socket Program Problem!!! Pin
John Bosko10-Dec-02 23:44
John Bosko10-Dec-02 23:44 
GeneralRe: Socket Program Problem!!! Pin
jhwurmbach10-Dec-02 23:54
jhwurmbach10-Dec-02 23:54 
GeneralRe: Socket Program Problem!!! Pin
John Bosko11-Dec-02 19:06
John Bosko11-Dec-02 19:06 
GeneralRe: Socket Program Problem!!! Pin
Rage11-Dec-02 0:06
professionalRage11-Dec-02 0:06 
GeneralRe: Socket Program Problem!!! Pin
Rage10-Dec-02 23:58
professionalRage10-Dec-02 23:58 
GeneralRe: Socket Program Problem!!! Pin
John Bosko11-Dec-02 0:00
John Bosko11-Dec-02 0:00 
GeneralRe: Socket Program Problem!!! Pin
Rage11-Dec-02 0:17
professionalRage11-Dec-02 0:17 
GeneralEnableMenuItem Pin
Sunnygirl10-Dec-02 22:52
Sunnygirl10-Dec-02 22:52 
GeneralRe: EnableMenuItem Pin
jhwurmbach10-Dec-02 23:46
jhwurmbach10-Dec-02 23:46 
GeneralRe: EnableMenuItem Pin
Sunnygirl10-Dec-02 23:52
Sunnygirl10-Dec-02 23:52 
GeneralRe: EnableMenuItem Pin
jhwurmbach11-Dec-02 0:03
jhwurmbach11-Dec-02 0:03 
GeneralRe: EnableMenuItem Pin
Sunnygirl11-Dec-02 0:10
Sunnygirl11-Dec-02 0:10 
GeneralRe: EnableMenuItem Pin
jhwurmbach11-Dec-02 0:32
jhwurmbach11-Dec-02 0:32 

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.