现在的位置: 首页 > 综合 > 正文

mfc调用console界面

2018年06月06日 ⁄ 综合 ⁄ 共 229字 ⁄ 字号 评论关闭

//头文件
#include <io.h>
#include <fcntl.h>
#include <stdio.h>
//开启console界面
void OpenConsole()
{
	AllocConsole();
	HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
	int hCrt = _open_osfhandle((long)handle,_O_TEXT);
	FILE * hf = _fdopen( hCrt, "w" );
	*stdout = *hf;
}

抱歉!评论已关闭.