AllocConsole();
FILE* m_new_stdout_file=NULL;
freopen_s(&m_new_stdout_file, "CONOUT$", "w+t", stdout);
FILE* m_new_stdout_file=NULL;
freopen_s(&m_new_stdout_file, "CONOUT$", "w+t", stdout);
cout << ">>>to MFC Debuge " << endl;
添加此代码:控制台输出 >>>to MFC Debuge
用完记得关闭 fclose(m_new_stdout_file);