This topic applies to:
Visual Studio Edition
Visual Basic
C#
C++
J#
Express
No
Native
Standard
Pro/Team
MFC provides classes and functions for detecting memory that is allocated but never deallocated.
Discusses the DEBUG_NEW macro, which you can use to locate memory leaks. Information includes considerations in Debug and Release versions, defining the macro in your source files, and object dumps.
Provides steps for enabling diagnostic tracing and selecting specific memory diagnostic features with afxMemDF (for more precise control).
Shows how to take snapshots of memory to help locate memory leaks.
Describes the CMemoryState::Difference function (compares memory) and the CMemoryState::DumpStatistics (prints memory statistics) and provides code examples.
Provides information on object dumps, including the DumpAllObjectsSince function, example code, and considerations, as well as interpreting and customizing object dumps.
How to use the C run-time library to detect memory leaks.
Links you to debugging techniques for MFC programs, including: afxDebugBreak, the TRACE macro, detecting memory leaks in MFC, MFC assertions, and reducing the size of MFC Debug builds.
Discusses some common debugging problems and techniques for C and C++ applications.