vc6

View the Project on GitHub littleflute/vc6

//File: BlConsole.h
/*
2017.05.04 2:30 AM bjt
littleflute
*/


#include "stdio.h"
#include <io.h>
#include <fcntl.h>
class CBlConsole
{
public:
	void CBlConsole::InitConsole()
	{
		int hCrt; 
		FILE *hf; 
		AllocConsole(); 
		hCrt = _open_osfhandle( 
			(long)GetStdHandle(STD_OUTPUT_HANDLE), 
			_O_TEXT ); 
		hf = _fdopen( hCrt, "w" ); 
		*stdout = *hf; 
		setvbuf( stdout, NULL, _IONBF, 0 ); 
		printf("InitConsoleWindow OK!\n\n"); 
	}
};