本文整理汇总了C++中_com_error::ErrorMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ _com_error::ErrorMessage方法的具体用法?C++ _com_error::ErrorMessage怎么用?C++ _com_error::ErrorMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_com_error
的用法示例。
在下文中一共展示了_com_error::ErrorMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReportErrorInfo
void ReportErrorInfo(_com_error &e,LPCTSTR szErrorFile,int iLine)
{
TCHAR tsErrorInfo[1024];
TCHAR *pStr;
int iRet;
pStr=tsErrorInfo;
iRet=_stprintf(pStr,_T("Error\r\n"));
pStr+=iRet;
iRet=_stprintf(pStr,_T("Code=%lx\r\n"),e.Error());
pStr+=iRet;
if(e.ErrorMessage()!=NULL)
{
iRet=_stprintf(pStr,_T("Code meaning=%s\r\n"),e.ErrorMessage());
pStr+=iRet;
}
if(e.Source().length()>0)
{
iRet=_stprintf(pStr,_T("Source=%s\r\n"),(LPCTSTR)e.Source());
pStr+=iRet;
}
if(e.Description().length()>0)
{
iRet=_stprintf(pStr,_T("Description=%s\r\n"),(LPCTSTR)e.Description());
pStr+=iRet;
}
ReportErrorInfo(tsErrorInfo,szErrorFile,iLine);
}
示例2: dump_com_error
void CADO::dump_com_error(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
g_logger.error("ADO Error Code = %08lx Code meaning = %s Source = %s Description = %s",
e.Error(), e.ErrorMessage(), (LPCTSTR)bstrSource, (LPCTSTR)bstrDescription);
}
示例3: PrintErrorInfo
/*打印错误消息*/
void CDBOperation::PrintErrorInfo(_com_error &e){
std::cout << "Error information are as follows" << std::endl;
std::cout << "ErrorNo: " << e.Error() << std::endl;
std::cout << "Error Message :" << e.ErrorMessage() << std::endl;
std::cout << "Source : " << e.Source() << std::endl;
std::cout << "Error Description : " << e.Description() << std::endl;
}
示例4: OutputDBErrMsg
void CNHSQLServerDBO::OutputDBErrMsg(const _com_error& e)
{
const int nErrMsgLength(MAX_PATH);
wchar_t *pwchErrMsg = new wchar_t[nErrMsgLength]();
_snwprintf_s(pwchErrMsg, nErrMsgLength, _TRUNCATE, L"错误编号:%08lx 错误信息:%s 错误源:%s 错误描述:%s",
e.Error(),
e.ErrorMessage(),
(LPCWSTR)e.Source(),
(LPCWSTR)e.Description());
// 输出错误信息到输出窗口
OutputDebugStringW(L"\t");
OutputDebugStringW(pwchErrMsg);
OutputDebugStringW(L"\n");
// 输出错误信息到日志文件
if (0 != wcscmp(m_wchLogFilePath, L""))
{
// 当日志文件路径不为空时,写日志
CNHLogAPI::WriteLogEx(m_wchLogFilePath, LOG_ERR, L"NHSQLServerDBO", pwchErrMsg);
}
if (NULL != pwchErrMsg)
{
delete[] pwchErrMsg;
pwchErrMsg = NULL;
}
}
示例5: msg
void
task::error_reply( const _com_error& e, const std::string& method )
{
_bstr_t msg( _bstr_t(L"Error: ") + e.Description() + L": " + e.ErrorMessage() );
for ( auto& reply: reply_handlers_ )
reply( method, static_cast< const char *>( msg ) );
}
示例6: ExceptionInfo
void CFoxBase::ExceptionInfo(_com_error &e)
{
if(e.Description().length()>0)
ExceptionInfo(e.Description());
else
ExceptionInfo(e.ErrorMessage());
}
示例7: on_excetion
void HiDBOracle::on_excetion(const char* name, const char* sql, _com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
stringstream oss;
oss<<"source:"<<bstrSource<<"\nDescription:"<<bstrDescription<<"\nerror message:"<<e.ErrorMessage();
HiDBHelperOnError("HiDBOracle::ExecuteQuery", oss.str().c_str(), sql, e.Error());
}
示例8: ErrorHandler
static void ErrorHandler(_com_error &e, char* ErrStr)
{
sprintf(ErrStr,"Error:\n");
sprintf(ErrStr,"%sCode = %08lx\n",ErrStr ,e.Error());
sprintf(ErrStr,"%sCode meaning = %s\n", ErrStr, (char*) e.ErrorMessage());
sprintf(ErrStr,"%sSource = %s\n", ErrStr, (char*) e.Source());
sprintf(ErrStr,"%sDescription = %s",ErrStr, (char*) e.Description());
}
示例9: dump_com_error
void dump_com_error(_com_error &e)
{
_tprintf(_T("Oops - hit an error!\n"));
_tprintf(_T("\a\tCode = %08lx\n"), e.Error());
_tprintf(_T("\a\tCode meaning = %s\n"), e.ErrorMessage());
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
_tprintf(_T("\a\tSource = %s\n"), (LPCTSTR) bstrSource);
_tprintf(_T("\a\tDescription = %s\n"), (LPCTSTR) bstrDescription);
}
示例10: dump_com_error
void dump_com_error(_com_error &e)
{
wprintf(L"Error\n");
wprintf(L"\a\tCode = %08lx\n", e.Error());
wprintf(L"\a\tCode meaning = %s", e.ErrorMessage());
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
wprintf(L"\a\tSource = %s\n", (LPCSTR) bstrSource);
wprintf(L"\a\tDescription = %s\n", (LPCSTR) bstrDescription);
}
示例11: dump_com_error
void dump_com_error(_com_error &e)
{
CString strError;
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
// Print Com errors.
strError.Format(_T("Database Engine Error\n\nCode %08lx\nmean:%s\nSource: %s\nDescription: %s\n"),
e.Error(), e.ErrorMessage(), (LPTSTR) bstrSource, (LPTSTR) bstrDescription);
AfxMessageBox(strError,MB_OK+MB_ICONERROR);
}
示例12: PrintComError
void PrintComError(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
// Print COM errors.
PTRACE(1, "catch _com_error:\tError = " << e.Error()
<< "\tErrorMessage = " << (const char*)e.ErrorMessage()
<< "\tSource = " << (const char*)bstrSource
<< "\tDescription = " << (const char*)bstrDescription
);
}
示例13: ErrCom
// ErrCom Function
void ErrCom(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
// Print Com errors.
printf("Error\n");
printf("\tCode = %08lx\n", e.Error());
printf("\tCode meaning = %s\n", e.ErrorMessage());
printf("\tSource = %s\n", (LPCSTR) bstrSource);
printf("\tDescription = %s\n", (LPCSTR) bstrDescription);
}
示例14: dump_com_error
//打印调用ADO控件时产生的详细错误信息
void LoadManage::dump_com_error(_com_error &e)
{
CString ErrorStr;
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
ErrorStr.Format( "/n/tADO Error/n/tCode = %08lx/n/tCode meaning = %s/n/tSource = %s/n/tDescription = %s/n/n",
e.Error(), e.ErrorMessage(), (LPCTSTR)bstrSource, (LPCTSTR)bstrDescription );
//在调试窗口中打印错误信息,在Release版中可用DBGView查看错误信息
::OutputDebugString((LPCTSTR)ErrorStr);
#ifdef _DEBUG
AfxMessageBox(ErrorStr, MB_OK | MB_ICONERROR);
#endif
}
示例15: dump_com_error
void CADORecordset::dump_com_error(_com_error &e)
{
TCHAR ErrorStr[1024];
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
swprintf(ErrorStr,sizeof(ErrorStr)/sizeof(ErrorStr[0]),
_T("CADORecordset Error\r\nCode = %08lx\r\nCode meaning = %s\r\nSource = %s\r\nDescription = %s\r\n"),
e.Error(),
e.ErrorMessage(),
(LPCTSTR)bstrSource,
(LPCTSTR)bstrDescription );
m_strLastError = _T("Query = ") + GetQuery() + _T('\r\n') + ErrorStr;
m_dwLastError = e.Error();
}