showErrorInfo

3412 단어 error
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; } }

......

좋은 웹페이지 즐겨찾기