VS2012 Express - new project throws exception at run time

Hi,
I have successfully set up cocos2d-x with Visual Studio 2012 Express, I can run HelloCpp and it works. The exception happens when I create a new project: the window with cocos logo and “Hello World” appears fine, then when I quit I get this message : “Run-Time Check Failure #2 - Stack around the variable ‘app’ was corrupted.”
For some reason it doesn’t happen when I try the same thing with VS 2010 Express (with a VS2010 project).
I’d really like to use VS2012, anyone has a clue ?

I had the same error. I’m not sure if this is the correct solution, but i added “exit(0);” to the default menuCloseCallback function, and the exception went away.

This next line of code is missing in the default new project in VS2012.

void HelloWorld::menuCloseCallback(CCObject* pSender)
{
    // "close" menu item clicked
    CCDirector::sharedDirector()->end();
    exit(0);
}

In the wiki it shows you the correct code as well: [[http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Menu_and_MenuItems]]

Maybe update the default project? I hope it helps…