program runs under xp but crash under vista
hello guys,
my program runs ok under the debug mode, but a little bit slow. so i compiled it with the release mode. and the program crashes.
the problematic function is the __tmainCRTStartup() function. and the error says "Unhandled exception at 0x7661fbae in xxx.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0033edd8.."
i don't know how to fix this, because the program crashes before it gets into my "main()" function.
i also tried to compile this program under windows xp. it runs perfectly under both debug and release mode.
i'm using vs2008.
any ideas?
thanks.
Re: program runs under xp but crash under vista
Quote:
Originally Posted by
billconan
the problematic function is the __tmainCRTStartup() function. and the error says "Unhandled exception at 0x7661fbae in xxx.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0033edd8.."
i don't know how to fix this, because the program crashes before it gets into my "main()" function.
The main() function is not the first function that is invoked in a C++ program.
Does your program contain global variables? If you have global variables that are objects, the constructor for those objects get initialized before main() is reached. So if this is the case, the constructor for one of your globals is faulty.
Regards,
Paul McKenzie