当前位置: 首页>>代码示例>>C++>>正文


C++ _com_error::Source方法代码示例

本文整理汇总了C++中_com_error::Source方法的典型用法代码示例。如果您正苦于以下问题:C++ _com_error::Source方法的具体用法?C++ _com_error::Source怎么用?C++ _com_error::Source使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在_com_error的用法示例。


在下文中一共展示了_com_error::Source方法的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);
	}
开发者ID:uesoft,项目名称:AutoIPED,代码行数:34,代码来源:ExceptionInfoHandle.cpp

示例2: 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;
}
开发者ID:huanghao870620,项目名称:myproj,代码行数:8,代码来源:CDBOperation.cpp

示例3: 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);
}
开发者ID:felove2013,项目名称:felove_2015,代码行数:7,代码来源:zADO.cpp

示例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;
    }
}
开发者ID:musclecui,项目名称:Solution1,代码行数:27,代码来源:NHSQLServerDBO.cpp

示例5: 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());	
}
开发者ID:xumingxsh,项目名称:HiDB,代码行数:8,代码来源:HiDBOracle.cpp

示例6: 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());
}
开发者ID:radtek,项目名称:aitop,代码行数:8,代码来源:CDataBase.cpp

示例7: bstrSource

static 	void dump_com_error(_com_error &e)
{
	::AtlTrace("Error\n");
	//TRACE1("\a\tCode = %08lx\n", e.Error());
	//TRACE1("\a\tCode meaning = %s", e.ErrorMessage());
	_bstr_t bstrSource(e.Source());
	_bstr_t bstrDescription(e.Description());
	::AtlTrace("\a\tSource = %s\n", (LPCSTR) bstrSource);
	::AtlTrace("\a\tDescription = %s\n", (LPCSTR) bstrDescription);
}
开发者ID:amanrenishaw,项目名称:MTConnectGadgets,代码行数:10,代码来源:ResourceIntegrator.cpp

示例8: 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);
}
开发者ID:Jinjiego,项目名称:VCSamples,代码行数:10,代码来源:commail.cpp

示例9: 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);
}
开发者ID:kravietz,项目名称:TSLwatch,代码行数:10,代码来源:parseRootTsl.cpp

示例10: DbError

void DbError(_com_error &e)
{
	_bstr_t bstrSource(e.Source());
	_bstr_t bstrDescription(e.Description());
      
	CUString msg;
	msg.Format("\n\tSource :  %s \n\tdescription : %s \n ",(LPCSTR)bstrSource,(LPCSTR)bstrDescription);

	MessageBox(NULL, msg, "", MB_OK);
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:10,代码来源:WebSite_old.cpp

示例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); 
}
开发者ID:eseawind,项目名称:CoalQualityTestSystem,代码行数:11,代码来源:StdAfx.cpp

示例12: GetError

CString GetError(_com_error &e)
{	
	CString MsgBug;
	_bstr_t Source(e.Source());
	_bstr_t Description(e.Description());
	MsgBug.Format( "Ups!!! \nSource = %s\nDescription= %s\n",(LPCSTR)Source, (LPCSTR)Description );
	#ifdef _DEBUG
		AfxMessageBox( MsgBug, MB_OK | MB_ICONERROR );
	#endif	
	return MsgBug;
}
开发者ID:darwinbeing,项目名称:trade,代码行数:11,代码来源:GuiADODB.cpp

示例13: 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
		);
}
开发者ID:princetoad,项目名称:callback,代码行数:12,代码来源:database.cpp

示例14: 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);
}
开发者ID:GALICSOFT,项目名称:glc220_src,代码行数:13,代码来源:LnNetOledb.cpp

示例15: 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	
}
开发者ID:Strongc,项目名称:Mobis,代码行数:14,代码来源:LoadManage.cpp


注:本文中的_com_error::Source方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。