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

C / C++ / MFC

 
GeneralRe: error in msdev.exe while debugging vc app Pin
r i s h a b h s19-Jan-03 17:48
r i s h a b h s19-Jan-03 17:48 
GeneralRe: error in msdev.exe while debugging vc app Pin
Bartosz Bien19-Jan-03 23:36
Bartosz Bien19-Jan-03 23:36 
QuestionHow to know where a memory leak is generated? Pin
Joan M17-Jan-03 0:55
professionalJoan M17-Jan-03 0:55 
AnswerRe: How to know where a memory leak is generated? Pin
benjymous17-Jan-03 1:00
benjymous17-Jan-03 1:00 
GeneralRe: How to know where a memory leak is generated? Pin
Joan M17-Jan-03 1:08
professionalJoan M17-Jan-03 1:08 
GeneralRe: How to know where a memory leak is generated? Pin
jhwurmbach17-Jan-03 2:12
jhwurmbach17-Jan-03 2:12 
AnswerRe: How to know where a memory leak is generated? Pin
xxhimanshu17-Jan-03 1:15
xxhimanshu17-Jan-03 1:15 
AnswerRe: How to know where a memory leak is generated? Pin
Chris Richardson17-Jan-03 10:43
Chris Richardson17-Jan-03 10:43 
Since you are using MFC, put the following code at the top of each source file in your program (after the #includes):

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


Then, when you get these memory leaks, you will be able to see the location where you allocate the object that you are leaking.

Note that it's possible to do this even if you don't use MFC, but then you have to write your own new and delete operators, and I don't want to explain all that.

Chris Richardson

Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
GeneralRe: How to know where a memory leak is generated? Pin
Joan M17-Jan-03 10:59
professionalJoan M17-Jan-03 10:59 
Generalprocess information Pin
Rizwan Rafique17-Jan-03 0:17
Rizwan Rafique17-Jan-03 0:17 
GeneralTask manager? Pin
AlexO17-Jan-03 3:02
AlexO17-Jan-03 3:02 
GeneralRe: process information Pin
Eanna M-annion17-Jan-03 6:24
Eanna M-annion17-Jan-03 6:24 
Questionbug in CPrintDialog with Win95/98 ? Pin
jpg17-Jan-03 0:12
jpg17-Jan-03 0:12 
AnswerRe: bug in CPrintDialog with Win95/98 ? Pin
jpg17-Jan-03 2:57
jpg17-Jan-03 2:57 
GeneralOf Rich Text, images and memory leaks Pin
Daniel Salby17-Jan-03 0:12
Daniel Salby17-Jan-03 0:12 
GeneralXP Style Pin
Ajesh kumar17-Jan-03 0:12
Ajesh kumar17-Jan-03 0:12 
Generalmemory allocation Pin
Paul Silvernail17-Jan-03 0:09
Paul Silvernail17-Jan-03 0:09 
GeneralRe: memory allocation Pin
Hesham Amin17-Jan-03 2:54
Hesham Amin17-Jan-03 2:54 
GeneralRe: memory allocation Pin
AlexO17-Jan-03 2:59
AlexO17-Jan-03 2:59 
GeneralRe: memory allocation Pin
Paul Silvernail17-Jan-03 6:28
Paul Silvernail17-Jan-03 6:28 
GeneralRe: memory allocation Pin
AlexO17-Jan-03 6:47
AlexO17-Jan-03 6:47 
GeneralRe: memory allocation Pin
Paul Silvernail17-Jan-03 10:06
Paul Silvernail17-Jan-03 10:06 
GeneralUrgent __asm question Pin
yektoop17-Jan-03 0:05
yektoop17-Jan-03 0:05 
GeneralRe: Urgent __asm question Pin
geo_m17-Jan-03 0:15
geo_m17-Jan-03 0:15 
GeneralRe: Urgent __asm question Pin
peterchen17-Jan-03 1:14
peterchen17-Jan-03 1:14 

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.