The MFC program that I am debugging prints this message in the Exit window in Visual Studio 9.0:
HEAP[AppName.exe]: Invalid allocation size - 99999998 (exceeded 7ffdefff)
I am sure that this is due to a bad "new", uninitialized variable or similar error.
The question arises: how do I get the debugger to stop on this message so that I can view the stack trace and solve the problem?
Edit: The following snippets do not give the same warning. Instead, they create a style message Invalid allocation size: 4294967295 bytes..
int stupid = -1;
char *bob = new char[stupid];
and
malloc(-1);
So, I suspect that this comes from a system DLL with its own memory management or uses a different API.