GUI with console window
1.
#ifdef CONSOLE
AllocConsole();
SetConsoleTitle(_T("Debug Console"));
freopen("conin$", "r+t", stdin);
freopen("conout$", "w+t", stdout);
freopen("conout$", "w+t", stderr);
#endif
...........................................................
#ifdef CONSOLE
fclose(stderr);
fclose(stdout);
fclose(stdin);
FreeConsole();
#endif
2.Post-Build Command Line
editbin /SUBSYSTEM:CONSOLE $(OutDir)\$(ProjectName).exe