Click here to Skip to main content
15,889,909 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralScrolling in Listbox Pin
kubbazoob11-Dec-02 0:06
kubbazoob11-Dec-02 0:06 
GeneralRe: Scrolling in Listbox Pin
Joan M11-Dec-02 5:18
professionalJoan M11-Dec-02 5:18 
GeneralRe: Scrolling in Listbox Pin
Alvaro Mendez11-Dec-02 8:43
Alvaro Mendez11-Dec-02 8:43 
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 
This statement m_hFont = hNewFont does not "make a copy" of the font, all you have done is assigned the variable m_hFont to hNewFont. m_hFont is a HANDLE it just points to some memory location, i.e. the same memory location as hNewFont. So basically don't delete hNewFont.

I suggest in the construtor
m_hFont = NULL;

then

if(m_hFont)
DeleteObject(hFont)
m_hFont = NULL;
hNewFont = ::CreateFont
if (hNewFont)
{
SetMyFont(hNewFont);
}

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 
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 

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.