title: Visual Studio 2008 (C++) memory leak detection not showing file/method location - how to get that to work?
body: <p>I am using the <a href="http://msdn.microsoft.com/en-us/library/e5ewb1h3(VS.80).aspx" rel="noreferrer">instructions found here</a> to try to find memory leaks in a Win32 application.  As described, I put the </p>
  
  <pre><code>#define _CRTDBG_MAP_ALLOC
  #include &lt;stdlib.h&gt;
  #include &lt;crtdbg.h&gt;
  </code></pre>
  
  <p>Lines at the top of a file (the cpp file that contains WINAPI _tWinMain) and then at the exit point of winmain I added </p>
  
  <pre><code>_CrtDumpMemoryLeaks();
  </code></pre>
  
  <p>Unfortunately I do not see the line numbers/locations for the leaks (but I do get a list of leaks).</p>
  
  <p>I also tried putting </p>
  
  <pre><code>_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); 
  _CrtSetReportMode ( _CRT_ERROR, _CRTDBG_MODE_DEBUG); 
  </code></pre>
  
  <p>at the beginning of winmain - and again, no luck.</p>
  
  <p>I find this odd because I usually have had no problems ever finding leaks or having them reported automatically.</p>
  
  <p>This is a huge, old legacy app I am working on for a new employer.  In the past I have worked from the standard VS wizard.</p>
  
  <p>Any suggestions on how to get source lines/methods that are causing the leaks?  (or at least the lines for the "new" calls?</p>
  
  <p>EDIT:</p>
  
  <p><a href="http://www.codeproject.com/KB/applications/visualleakdetector.aspx" rel="noreferrer">I also tried visual leak detector</a> - with no success.</p>
  
  <p>Very strange.</p>
  
  <p>EDIT</p>
  
  <p>I tried using the redefinition of new as listed below, however I get errors when boost is compiled in.  </p>