Detecting Win32 memory leaks in VS6 IDE

Hi
I made a sample Win32 Console program to know if the VC++ debugger will detect memory leaks in Win32 apps:
#include "stdafx.h"

int main(int argc, char* argv[])
{
printf("Hello World!\n");
char* ch=new char[100];
return 0;
}
this shows a clear 100 bytes memory leak
After the program ends .. the debugger did not notify me about any memory leaks

But when making a Win32 Console program with MFC Support and try the same sample I get this :

Detected memory leaks!
Dumping objects ->
H:\Try\memLeakMFC\memLeakMFC.cpp(39) : {56} normal block at 0x002F2AA0, 100 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.

How can I make the debugger detect Win32 apps memory leaks ?
Is there any other way to do it ?
[868 byte] By [hspc] at [2007-11-18 22:17:00]
# 1 Re: Detecting Win32 memory leaks in VS6 IDE
How can I make the debugger detect Win32 apps memory leaks ?
Is there any other way to do it ?Have a look a _CrtDumpMemoryLeaks(), and the other related debug functions (their names usually begin with _Crt...). The reason why MFC apps automatically dump memory leaks is because the calls to the memory checking functions are built into the framework. In a non-MFC app, you will have to call them yourself.
gstercken at 2007-11-9 13:11:18 >
# 2 Re: Detecting Win32 memory leaks in VS6 IDE
Detecting Memory Leaks ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_detecting_memory_leaks.asp)
Detecting Memory Leaks in MFC ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/_core_detecting_memory_leaks.asp)
Andreas Masur at 2007-11-9 13:12:19 >