摘自: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");

}

  

相关文章:

  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2021-12-25
  • 2021-10-16
  • 2022-12-23
猜你喜欢
  • 2022-01-08
  • 2021-04-08
  • 2021-07-11
  • 2021-09-22
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
相关资源
相似解决方案