Re: _CrtSetDbg to look for memory management errors

  • From: "Will Pearson" <will@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Tue, 30 Oct 2007 23:14:51 -0000

Hi Chris,

From MSDN:
"Setting the CRT Report Mode

By default, _CrtDumpMemoryLeaks dumps memory leak information to the Debug pane of the Output window, as described previously. You can reset this to dump to another location using _CrtSetReportMode. If you use a library, it may reset the output to another location. In that case, you can set the output location
back to the Output window using the following statement:

CopyCode image
Copy Code

For more information, see _CrtSetReportMode."

----- Original Message ----- From: "Delaunay Christophe" <christophe.delaunay@xxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Tuesday, October 30, 2007 2:33 PM
Subject: _CrtSetDbg to look for memory management errors

Hi list,

I'm developping in C++ with Visual Studio 2003 and am currently
experiencing a critical memory management problem. I've written a really
annoying bug somewhere in my code which cause some of my buffers to be

I'd like to do the following in order to track my bug(s):

(1) Call _CrtSetDbgFlag(_CRTDBG_CHECK_ALWAYS_DF) at the beginning of my
main module in order to thoroughly check the heap of my app during its

(2) Redirect the so-called "debug heap manager" messages to some file
other than the Visual Studio Output Window.

This is this second operation I don't know how to perform. Please could
someone explain me which calls I should insert into my code to perform
this debug heap manager output and error redirection?

Many thanks in advance. Have a nice day. ChD
View the list's information and change your settings at
View the list's information and change your settings at //

Other related posts: