zoukankan      html  css  js  c++  java
  • windows 重写调试输出

    // 使用OutputDebugString很不方便.不能自定义格式化输出.所以重写了一下.

    #include <tchar.h>
    #include <windows.h>
    
    
    void __cdecl MyOutputDebugStrig(const _TCHAR* pszFormat, ...)
    {
    	_TCHAR buf[1024] = { 0 };
    	// ZeroMemory( buf, 1024*sizeof(TCHAR ) );
    	swprintf_s(buf, 1024, _T("线程ID = [%lu]"), GetCurrentThreadId());
    	va_list arglist;
    	va_start(arglist, pszFormat);
    	int nBuffSize = _tcslen(buf);
    	vswprintf_s(&buf[nBuffSize], 1024 - nBuffSize, pszFormat, arglist);
    	va_end(arglist);
    	nBuffSize = _tcslen(buf);
    	_tcscat_s(buf, 1024 - nBuffSize, _T("
    "));
    	OutputDebugString(buf);
    }
    注意,请使用UNICODE字符集.
    
  • 相关阅读:
    numpy 矩阵和数组
    python map()
    python matplotlib plot
    python mean()
    预测数值型数据:回归
    散点图
    非均衡分类问题
    AdaBoost元算法
    2.1 n元排列
    1.3 数域
  • 原文地址:https://www.cnblogs.com/iBinary/p/10754737.html
Copyright © 2011-2022 走看看