Click here to Skip to main content
15,911,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralC++ control to ActiveX and C++ control to DLL Pin
29-Aug-01 11:11
suss29-Aug-01 11:11 
GeneralRe: C++ control to ActiveX and C++ control to DLL Pin
29-Aug-01 11:20
suss29-Aug-01 11:20 
GeneralRe: C++ control to ActiveX and C++ control to DLL Pin
29-Aug-01 11:55
suss29-Aug-01 11:55 
GeneralListBox Control Pin
RobJones29-Aug-01 9:42
RobJones29-Aug-01 9:42 
GeneralRe: ListBox Control Pin
Not Active29-Aug-01 14:18
mentorNot Active29-Aug-01 14:18 
GeneralRe: ListBox Control Pin
Michael Dunn29-Aug-01 14:30
sitebuilderMichael Dunn29-Aug-01 14:30 
GeneralRe: ListBox Control Pin
RobJones30-Aug-01 4:58
RobJones30-Aug-01 4:58 
GeneralOwner draw static control and memory leak Pin
Peter Pearson29-Aug-01 9:38
Peter Pearson29-Aug-01 9:38 
Hi,

I've written a very simple custom static control that allows you certain control over formatting via HTML type tags (bold, italic and underlined).

I've got it working, but when you drag a window over the control and it gets repainted, the memory usage for the program goes up collosally, which is obviously a memory leak.

I've traced the problem to creating the fonts, via CFont, but despite DeleteObjects and just plain deletes of the CFont object/pointer, the memory leak is still there.

I'm creating a font every time the WM_PAINT message is called using the CreateFont() function. I've tried saving the old font then restoring the old font at the end but this doesn't help either.

Is anyone who knows what they're doing with GDI willing to have a look through the code (180 lines .cpp and .h) if I email it to them, as I really haven't a clue what's wrong.

Many thanks,
Peter
GeneralRe: Owner draw static control and memory leak Pin
Tomasz Sowinski29-Aug-01 9:51
Tomasz Sowinski29-Aug-01 9:51 
GeneralRe: Owner draw static control and memory leak Pin
Peter Pearson29-Aug-01 10:02
Peter Pearson29-Aug-01 10:02 
GeneralRe: Owner draw static control and memory leak Pin
Tomasz Sowinski29-Aug-01 10:01
Tomasz Sowinski29-Aug-01 10:01 
GeneralRe: Owner draw static control and memory leak Pin
Peter Pearson29-Aug-01 10:04
Peter Pearson29-Aug-01 10:04 
GeneralRe: Owner draw static control and memory leak Pin
Tomasz Sowinski29-Aug-01 10:13
Tomasz Sowinski29-Aug-01 10:13 
GeneralRe: Owner draw static control and memory leak Pin
Peter Pearson29-Aug-01 11:32
Peter Pearson29-Aug-01 11:32 
GeneralDifference between 2 CTime objects Pin
duggie29-Aug-01 9:24
duggie29-Aug-01 9:24 
GeneralRe: Difference between 2 CTime objects Pin
Tomasz Sowinski29-Aug-01 9:44
Tomasz Sowinski29-Aug-01 9:44 
GeneralRe: Difference between 2 CTime objects Pin
duggie29-Aug-01 10:06
duggie29-Aug-01 10:06 
GeneralRe: Difference between 2 CTime objects Pin
Tomasz Sowinski29-Aug-01 10:21
Tomasz Sowinski29-Aug-01 10:21 
GeneralRe: Difference between 2 CTime objects Pin
duggie29-Aug-01 10:47
duggie29-Aug-01 10:47 
GeneralCHTMLView And ActiveX Documents Pin
AJ12329-Aug-01 8:37
AJ12329-Aug-01 8:37 
GeneralCOleDateTime in CRecordset Pin
duggie29-Aug-01 8:16
duggie29-Aug-01 8:16 
General(ISAPI) SAVING SESSION VARIABLES Pin
29-Aug-01 7:56
suss29-Aug-01 7:56 
GeneralDialog Box problems Pin
29-Aug-01 7:41
suss29-Aug-01 7:41 
GeneralRe: Focus Problem Pin
29-Aug-01 9:59
suss29-Aug-01 9:59 
GeneralRe: Focus Problem Pin
Paolo Messina29-Aug-01 12:30
professionalPaolo Messina29-Aug-01 12:30 

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.