AfxEnableMemoryTracking

跟踪内存诊断在 MFC 调试版本通常启用。

BOOL AfxEnableMemoryTracking( 
   BOOL bTrack  
);

参数

  • bTrack
    设置为 TRUE 的值跟踪该打开内存;FALSE 关闭它。

返回值

启用跟踪标记以前的设置。

备注

使用此函数禁用在您知道正确分配块代码节的跟踪。

有关AfxEnableMemoryTracking, 的更多信息,请参见Debugging MFC Applications(调试 MFC 应用程序).

备注

此函数仅在 MFC 调试版本中工作。

示例

BOOL CMyWinApp::InitInstance()
{
#ifdef _DEBUG
   // Disable tracking of memory for the scope of the InitInstance()
   AfxEnableMemoryTracking(FALSE);
#endif  // _DEBUG 

   // ...

#ifdef _DEBUG
   // Re-enable tracking of memory
   AfxEnableMemoryTracking(TRUE);
#endif  // _DEBUG 

   return TRUE;
}

要求

头文件: afx.h

请参见

概念

MFC 宏和全局函数