VC2005建立一个支持MFC的控制台程序,把CWinApp 对象从全局变量挪到变成局部变量,加入CMemoryState来追踪,如下:#include "stdafx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
    CMemoryState msOld;
    msOld.Checkpoint();
    CWinApp theApp;
    msOld.DumpAllObjectsSince();
    return 0;
}
F5执行结束,Debug窗口显示:
Dumping objects ->
Object dump complete.
The program '[2672] testDump01.exe: Native' has exited with code 0 (0x0).这里并没有我想要的CWinApp对象的信息啊。为什么?