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 

posted @ 2010-08-26 00:46  史莱姆  阅读(284)  评论(0编辑  收藏  举报