Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Diagnostic Services
                                              Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  This topic describes a group of macros and global functions that provide
  diagnostic services. All these functions, except as noted, require the
  Debug version of the Microsoft Foundation Class Library.
 
  In the Debug library, all allocated memory blocks are bracketed with a
  series of "guard bytes." If these bytes are disturbed by an errant
  memory write, then the diagnostic routines can report the problem.
 
  The diagnostic services fall into the following three categories:
 
  General Diagnostic Macros      Diagnostic macros that do not relate to
                                   an object of class CObject.
 
  General Diagnostic Functions   Diagnostic functions that do not relate
                                   to an object of class CObject.
 
  Object Diagnostic Functions    Diagnostic functions that relate to an
                                   object of class CObject.
 
  If you include the line
 
      #define new DEBUG_NEW
 
  in your implementation file, then all calls to new will store the
  filename and line number where the memory allocation took place. The
  DumpAllObjectsSince function of the CMemoryState class will display this
  extra information, thus greatly simplifying the identification of memory
  leaks.
 
  Since many of these diagnostic functions are designed for tracking
  memory errors, you should refer to the "Memory Management" section in
  Chapter 7 of the <Class Libraries User's Guide> for a discussion of
  memory allocation for both MS-DOS and Windows while using the Microsoft
  Foundation Class Library. Refer also to the class CDumpContext for
  additional information on diagnostic output.
 
  To use these macros and global functions, add the following directives
  to the top of your program:
 
  #define _DEBUG
 
  #include <afx.h>
 
 
                                     -♦-