SimpleDao
win32项目中调出和隐藏控制台
2019-05-06, 访问数: 1118

显示控制台,并且能用print打印显示,方便调试

  1. ::AllocConsole();
  2. ::SetConsoleTitle(_T("测试控制台"));
  3. freopen("conin$","r+t",stdin);
  4. freopen("conout$","w+t",stdout);
  5. freopen("conerr$","w+t",stderr);
  6. //释放
  7. FreeConsole();

win32控制台工程隐藏dos窗口

  1. #pragma comment( linker, "/subsystem:windows /entry:mainCRTStartup" )