调试 -- 为GUI程序添加控制台调试信息输出

//z 2014-08-09 22:35:42 L.144' 5058 BG57IV3@BYH T3162696792.K.F3863291090[T5,L330,R3,V36] IS2120
1. 在winmain 中添加
AllocConsole();
freopen("CONIN$", "r", stdin);
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);

2. 定义全局的宏
#ifdef _DEBUG
# define Debug(fmtstr, ...) printf(fmtstr, ##__VA_ARGS__)
#else
# define Debug(fmtstr, ...)
#endif

posted @ 2014-08-09 22:35  BiG5  阅读(253)  评论(0编辑  收藏  举报