[转]MFC 调用 printf 输出

摘自:http://blog.csdn.net/miyunhong/article/details/6704121

#include <io.h>
#include <fcntl.h> void OpenConsole()
{
AllocConsole();
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
int hCrt = _open_osfhandle((long)handle,_O_TEXT);
FILE * hf = _fdopen( hCrt, "w" );
*stdout = *hf;
}

  

BOOL CHappyMFCApp::InitInstance()
{
OpenConsole();
printf("asdf"); }

  

上一篇:04、NetCore2.0下Web应用之Startup源码解析


下一篇:[转发] 理解 oauth 2.0