   Catching leaks in MFC?
  I have some memory leaks in my mfc program, and I''m trying to find out where they are. I''ve read I''m supposed to include something like:#define _CRTDBG_MAP_ALLOC#include <stdlib.h>#include <crtdbg.h>and then add another statement at the beginning of my program, but I don''t know where the ''beginning'' is for MFC. I tried adding _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); in numerous places in the main app file, but I didn''t get anything. 
  http://gha.booleangate.org/archive/Detecting_and_isolating_memory_leaks_using_MS_VC++.html ;  Yes, I''ve already seen that and it hasn''t helped me. ;  Are you running in debug mode? ;  I get this output:Dumping objects ->{48} normal block at 0x00C52638, 33 bytes long. Data: < C    > 00 43 00 CD CD CD CD CD CD CD CD CD CD CD CD CD {47} normal block at 0x00C525D0, 40 bytes long. Data: < |L   > 14 7C 4C 10 16 00 00 00 00 00 00 00 00 00 00 00 Object dump complete.  So I put _CrtSetBreakAlloc(48); at the beginning of InitInstance() in my main app file, but it didn't do anything.   [edited by - Sfpiano on February 8, 2004 12:22:13 PM];This might be a useful article to read.  It might be more then what you need but hey it is pretty simple to implement.   Richard DickersonPikestriker Games "Kids you tried hard and failed miserably, lesson learned never try" - Homer Simpson 