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


C++ _com_error类代码示例

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


在下文中一共展示了_com_error类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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 ) );
}
开发者ID:hermixy,项目名称:qtplatz,代码行数:7,代码来源:digitizer.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: HandleComErrorException

//*****************************************************************************
//* Function Name: HandleComErrorException
//*   Description: Handle a _com_error exception. This routine is called from
//*                catch blocks for _com_error exceptions.
//*****************************************************************************
HRESULT HandleComErrorException (
	LPCTSTR				p_lpszFile,
	UINT				p_uLine,
	const _com_error&	p_ce)
{
	(void) HandleFacilityInternetComErrorException (p_ce);

	// Preserve the logical thread's error object. This is cleared when
	// _com_issue_error[ex] calls the Automation ::GetErrorInfo() function.

	// Attach the raw interface pointer returned by _com_error::ErrorInfo()
	// to our smart pointer. _com_error::ErrorInfo() AddRef's the raw
	// interface pointer that it returns. We want to encapsulate this
	// raw interface pointer in a smart pointer without performing an
	// additional AddRef.
	IErrorInfoPtr l_spErrorInfo (p_ce.ErrorInfo (), false /* fAddRef */);

	if (l_spErrorInfo) {
		// There is one reference to the error object in p_ce. There is another
		// reference in l_spErrorInfo. Both of these references will be released
		// by the time we leave the caller's catch block. The COM run-time's
		// reference to the error object will have been cleared when
		// _com_issue_error[ex] was called. By calling SetErrorInfo(),
		// we preserve the logical thread's error object.
		(void) ::SetErrorInfo (0 /* dwReserved */, l_spErrorInfo);
	}

	return p_ce.Error ();
}
开发者ID:taylorjg,项目名称:WineApi_CXX,代码行数:34,代码来源:ComErrorHandling.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: ExceptionInfo

void CFoxBase::ExceptionInfo(_com_error &e)
{
	if(e.Description().length()>0)
		ExceptionInfo(e.Description());
	else
		ExceptionInfo(e.ErrorMessage());
}
开发者ID:uesoft,项目名称:AutoIPED,代码行数:7,代码来源:FoxBase.cpp

示例6: 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

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

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

示例9: 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

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

示例11: 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

示例12: dump_com_error

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

示例13: 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

示例14: 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

示例15: 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


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