只要在InitInstance()中加入下面下面的代码就可以 AllocConsole(); freopen("CONOUT$","w+t",stdout); freopen("CONIN$","r+t",stdin);