带dos调试窗口的win32程序
2012-07-30 18:49
197 查看
#include <locale.h>
#define CREATE_DEBUG_CONSOLE \
FILE* fpDebugOut = NULL; \
FILE* fpDebugIn = NULL; \
FILE* fpDebugErr = NULL; \
if( !AllocConsole() ) \
MessageBox(NULL, _T("控制台生成失败。"), NULL, 0); \
SetConsoleTitle(_T("Debug Window")); \
_tfreopen_s(&fpDebugOut, _T("CONOUT$"),_T("w"), stdout); \
_tfreopen_s(&fpDebugIn, _T("CONIN$"), _T("r"), stdin); \
_tfreopen_s(&fpDebugErr, _T("CONOUT$"),_T("w"), stderr); \
_tsetlocale(LC_ALL, _T("chs"));
#define RELEASE_DEBUG_CONSOLE \
fclose(fpDebugOut); \
fclose(fpDebugIn); \
fclose(fpDebugErr); \
FreeConsole();
#define CREATE_DEBUG_CONSOLE \
FILE* fpDebugOut = NULL; \
FILE* fpDebugIn = NULL; \
FILE* fpDebugErr = NULL; \
if( !AllocConsole() ) \
MessageBox(NULL, _T("控制台生成失败。"), NULL, 0); \
SetConsoleTitle(_T("Debug Window")); \
_tfreopen_s(&fpDebugOut, _T("CONOUT$"),_T("w"), stdout); \
_tfreopen_s(&fpDebugIn, _T("CONIN$"), _T("r"), stdin); \
_tfreopen_s(&fpDebugErr, _T("CONOUT$"),_T("w"), stderr); \
_tsetlocale(LC_ALL, _T("chs"));
#define RELEASE_DEBUG_CONSOLE \
fclose(fpDebugOut); \
fclose(fpDebugIn); \
fclose(fpDebugErr); \
FreeConsole();
相关文章推荐
- 在Win32程序中显示Dos调试窗口,可暂停(AllocConsole,WriteConsole,FreeConsole函数,GetStdHandle函数取得输入句柄)
- 在Win32程序中显示Dos调试窗口
- 带dos调试窗口的win32程序
- 在Win32程序中显示Dos调试窗口
- 带dos调试窗口的win32程序
- 在Win32程序中显示Dos调试窗口
- MFC,Win32程序向控制台(Console)窗口输出调试信息
- 在MFC,Win32程序中向控制台(Console)窗口输出调试信息
- 在MFC,Win32程序中向控制台(Console)窗口输出调试信息
- 在MFC,Win32程序中向控制台(Console)窗口输出调试信息
- 使用WIN32 API CreateProcess()以无窗口方式创建DOS程序
- win32程序中创建一个DOS窗口
- 在MFC,Win32程序中向控制台(Console)窗口输出调试信息
- 如何让VS调试的控制台程序在后台执行,不显示DOS窗口
- 使用WIN32 API CreateProcess()以无窗口方式创建DOS程序
- 在MFC,Win32程序中向控制台(Console)窗口输出调试信息
- 使用WIN32 API CreateProcess()以无窗口方式创建DOS程序
- mfc如何显示dos窗口,调试程序
- 在windows窗体程序中单独开一个dos命令行窗口,输出我们想要的信息(调试程序常用)
- 在MFC,Win32程序中向控制台(Console)窗口输出调试信息