win32 app里使用控制台打印调试信息

来源:互联网 发布:猪八戒软件开发 编辑:程序博客网 时间:2024/06/05 18:25
<span style="font-size:18px;">HANDLE hOutput;void console_init(void){    AllocConsole();       SetConsoleTitle("Debug Window");    hOutput=GetStdHandle(STD_OUTPUT_HANDLE);     //FreeConsole();  }void DebugPrint(char *fmt, ...){    DWORD uLen;    char buffer[4096];    int arg;    arg = (int)&fmt + sizeof(int);    vsprintf(buffer, fmt, (char *)arg);    WriteConsole(hOutput, buffer, strlen(buffer), &uLen, NULL);</span>



0 0
原创粉丝点击