摘要: 1 #include "StdAfx.h" 2 #include "CIMFile.h" 3 #include "Markup.h" 4 5 #ifdef UNICODE 6 #define _tcout(x) std::wcout << x; 7 #else 8 #define _tcout(x) std::cout << x; 9 #endif 10 11 char* Wide2Byte(const TCHAR* pWide) 12 { 13 char *pBytes = NULL; 14 int nLen 阅读全文
posted @ 2013-05-29 15:40 一刀倾城 阅读(416) 评论(0) 推荐(0) 编辑
摘要: 第一步:在CXXXXApp所在CPP文件内加入如下代码:#include <fcntl.h>void LauchConsole(){ AllocConsole(); HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); int hCrt = _open_osfhandle((long)handle ,_O_TEXT); FILE *hf = _fdopen(hCrt ,"w"); *stdout = *hf;}然后,在CXXXXApp::InitInstance()中调用LauchConsole就可以使用cout或者. 阅读全文
posted @ 2013-05-29 10:40 一刀倾城 阅读(361) 评论(0) 推荐(0) 编辑