zoukankan      html  css  js  c++  java
  • showErrorInfo

    void showErrorInfo(UINT nErrCode, UINT nLine, LPCTSTR lpFuncName, UINT nType);
    
    /**************************************************************** 
    // FunctionName    :    showErrorInfo
    // Function        :    显示错误信息
    // Parameter       :   nErrCode    :错误码
                           nLine      :__LINE__    
                           lpFuncName     :函数名称
                           nType          :该参数控制错误信息显示方式
    
    // Author      :    Lthis
    // Create          :    2015-3-23 21:09:34 
    // Checked         :    Lthis 2015-3-23 
    ****************************************************************/
    
    void CLoadNtDriver::showErrorInfo(UINT nErrCode, UINT nLine, LPCTSTR lpFuncName, UINT nType){
        LPTSTR lpMsgBuf = NULL;
        TCHAR szMessage[256] = { 0 };
        TCHAR szCaption[32]  = { 0 };
    
        FormatMessage(0x1300, NULL, nErrCode, 0x400, (LPTSTR)&lpMsgBuf, 64, NULL);
        StringCchPrintf(szMessage, 256, _T("Error code:0x%X:%s
    "), nErrCode, lpMsgBuf);
        StringCchPrintf(szCaption, 32, _T("%s (Error Line:%d)"), lpFuncName, nLine);
        StringCchCat(szMessage, 256+32+1, szCaption);
    
        switch (nType)
        {
        case 0:
            OutputDebugString(szMessage);
            break;
        case 1:
            MessageBox(NULL, szMessage, szCaption, 0);
            break;
        default:
            break;
        }
    }

    ......

  • 相关阅读:
    监控kubernetes集群的方式
    Prometheus的集群与高可用
    Grafana简单用法
    Prometheus实战之配置汇总
    Leetcode Surrounded Regions
    leetcode Spiral Matrix II
    leetcode Regular Expression Matching
    leetcode Set Matrix Zeroes
    leetcode 较难题II
    Leetcode 数独
  • 原文地址:https://www.cnblogs.com/Lthis/p/4361037.html
Copyright © 2011-2022 走看看