MSVC leak detection not writing to "file"
Using MSVC 9 SP1, I'm trying to use the basic technique described [here][1]:
I put this at the beginning of my main():

    _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
    _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
    _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);

At the end, I don't get anything written to stdout, even though I know there are leaks. If I comment out the SetReportMode calls and attach with the debugger, I get the leaks reported in the Output window as expected.

  [1]: http://msdn.microsoft.com/en-us/library/5at7yxcs%28v=VS.90%29.aspx
MSVC leak detection not writing to "file"
===

Using MSVC 9 SP1, I'm trying to use the basic technique described [here][1]:
I put this at the beginning of my main():

    _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
    _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
    _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);

At the end, I don't get anything written to stdout, even though I know there are leaks. If I comment out the SetReportMode calls and attach with the debugger, I get the leaks reported in the Output window as expected.

  [1]: http://msdn.microsoft.com/en-us/library/5at7yxcs%28v=VS.90%29.aspx