#include "crtdbg.h" . . . // put these close to WinMain (or main) entrance #ifndef NDEBUG // get current dbg flag (report it) int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); // logically OR leak check bit flag |= _CRTDBG_LEAK_CHECK_DF; // set the flags again _CrtSetDbgFlag(flag); #endif |
|
来自: benladeng45 > 《Windows 核心编程》