If you want more precise control over the memory diagnostic features, you can selectively turn individual memory diagnostic features on and off by setting the value of the MFC global variable afxMemDF. This variable can have the following values as specified by the enumerated type AfxMemDF:
These values can be used in combination by performing a logical-OR operation, as shown here:
AfxMemDF = allocMemDF | delayFreeMemDF | checkAlwaysMemDF;