• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dump_com_error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetDocument

void CLryEDBQryView::SingleReport(CReportSele *pDlg)
{
	_variant_t str;
	int nItemIndex;
	CLryEDBQryDoc* pDoc = GetDocument();
	if(( nItemIndex=GetListCtrl().GetNextItem(-1,LVNI_SELECTED))!=-1)
	{
		pDoc->Rs->Move(nItemIndex,(long)adBookmarkFirst);
		str = pDoc->Rs->GetCollect(_bstr_t("试验编号")); 		 
		CString	strSQL;
		strSQL.Format(_T("select * from 热容量 where  试验编号='%s'"),VariantToStr(str)); 		
		try
		{ 
			
			HRESULT hr; 
			
			if(pDoc->RsPrintData->State==adStateOpen)
				pDoc->RsPrintData->Close();			
			hr = pDoc->RsPrintData->Open(strSQL.AllocSysString(),
				theApp.pConn.GetInterfacePtr(),
				adOpenStatic,
				adLockOptimistic,
				-1);
			TESTHR(hr); 
			
			if(pDoc->RsTitle->State==adStateOpen)
				pDoc->RsTitle->Close();
			strSQL = _T("select * from 系统参数");
			hr = GetDocument()->RsTitle->Open(strSQL.AllocSysString(),
				theApp.pConn.GetInterfacePtr(),
				adOpenStatic,
				adLockOptimistic,
				-1);
			TESTHR(hr); 
			
			pReportdlg.Init(0);
			pReportdlg.SetModifyPrepared(TRUE);	
			LPCTSTR dbName2 = _T("CopyHeat");
			pReportdlg.AddAdoDataSet(dbName2,((CLryEDBQryDoc*)GetDocument())->RsTitle);
			pReportdlg.SetModifyPrepared(TRUE);
			LPCTSTR dbName1  = _T("SReportHeat");
			pReportdlg.AddAdoDataSet(dbName1,((CLryEDBQryDoc*)GetDocument())->RsPrintData);
			//nItemIndex = pDoc->RsPrintData->GetRecordCount();	
			//pDoc->RsPrintData->MoveFirst();
			CString File(pDlg->cPath);
			File+=_T("reports\\")+pDlg->cFile;
			LPCTSTR path = File.GetBuffer(File.GetLength());
			pReportdlg.SetReportFile(path);
			File.ReleaseBuffer();
			if(pDlg->m_iSelect==0)
				pReportdlg.ShowReport();       //设计报表 
			else
				pReportdlg.DesignReport();		// 预览报表 
		}
		catch(_com_error &e)
		{ 
			dump_com_error(e);
		} 
	}	
}
开发者ID:eseawind,项目名称:CoalQualityTestSystem,代码行数:60,代码来源:LryEDBQryView.cpp


示例2: parseError

_bstr_t MTConnectDeviceParser::ParseXMLDocument(_bstr_t xmlfile, _bstr_t xsdfile, _bstr_t xsdname)
{ 
	_bstr_t parseError(L"");

	try{
		IXMLDOMParseErrorPtr  pError;

		// load the XML file
		// ****** you need to use IXMLDOMDocument2 interface *********
		HRESULT hr = m_pXMLDoc.CreateInstance(__uuidof(MSXML2::DOMDocument));
		m_pXMLDoc->async =  VARIANT_FALSE; 

		hr = m_pXMLDoc->load(xmlfile);      

		//check on the parser error      
		if(hr!=VARIANT_TRUE)
		{
			return checkParseError(m_pXMLDoc->parseError);
		}
#if 0
		//load the XSD file
		if(xsdfile!=NULL)
		{
			hr = m_pXSDDoc.CreateInstance(__uuidof(MSXML2::DOMDocument));
			m_pXSDDoc->async =  VARIANT_FALSE; 

			hr = m_pXSDDoc->load(xsdfile /*"books.xsd"*/);

			//check on the parser error      
			if(hr!=VARIANT_TRUE)
			{         
				return checkParseError(m_pXSDDoc->parseError);
			}

			//create schemacache
			hr = m_pSchemaCache.CreateInstance(__uuidof(MSXML2::XMLSchemaCache));
			m_pXMLDoc->schemas = m_pSchemaCache.GetInterfacePtr();

			//hook it up with XML Document
			hr = m_pSchemaCache->add(xsdname /*"urn:books"*/, m_pXSDDoc.GetInterfacePtr());   

			//call validate 
			pError = m_pXMLDoc->validate();
		}
#endif
		//
		//if(pError->errorCode != S_OK)
		//{
		//	parseError = _bstr_t("Error code: ")+ _bstr_t(pError->errorCode) +_bstr_t("\n") + _bstr_t("Reason: ")+ pError->Getreason();
		//	MessageBox(NULL, (char*)parseError, "Parse Error",MB_OK);
		//}

	}
	catch(_com_error &e)
	{
		dump_com_error(e);
	}

	return parseError;
}
开发者ID:amanrenishaw,项目名称:MTConnectGadgets,代码行数:60,代码来源:MTConnectDeviceParser.cpp


示例3: switch

void CLryEDBQryView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
{
	
	
	CListCtrl  *ListCtrl = (CListCtrl  *)&GetListCtrl();
	CLryEDBQryDoc *pDoc = (CLryEDBQryDoc *)GetDocument();
	CLryEDBQryDoc::CRowObj *rowInfo;
	int i;
	switch(lHint)
	{
	case 0:
		FillList();			//填写表格
		break;
	case 1:
		try
		{
			i = pDoc->Rs->AbsolutePosition-1;
			ListCtrl->EnsureVisible(i,TRUE);		
		}
		catch(_com_error &e)
		{
			dump_com_error(e);
		}
		break;
	case 2:
		rowInfo = (CLryEDBQryDoc::CRowObj*)pHint;
		ListCtrl->DeleteItem(rowInfo->RowNO);
		ListCtrl->Update(rowInfo->RowNO);
		break;
	default:
		break;
	}	
	
}
开发者ID:eseawind,项目名称:CoalQualityTestSystem,代码行数:34,代码来源:LryEDBQryView.cpp


示例4: switch

BOOL CADORecordset::GetFieldValue(int nIndex, bool& bValue)
{
	_variant_t vtFld;
	_variant_t vtIndex;
	
	vtIndex.vt = VT_I2;
	vtIndex.iVal = nIndex;
	
	try
	{
		vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value;
		switch(vtFld.vt) 
		{
		case VT_BOOL:
			bValue = vtFld.boolVal == VARIANT_TRUE? true: false;
			break;
		case VT_EMPTY:
		case VT_NULL:
			bValue = false;
			break;
		default:
			return FALSE;
		}
		return TRUE;
	}
	catch(_com_error &e)
	{
		dump_com_error(e);
		return FALSE;
	}
}
开发者ID:zxlooong,项目名称:minica,代码行数:31,代码来源:ado2.cpp


示例5: ASSERT

BOOL CADOParameter::SetValue(CString strValue)
{
	_variant_t vtVal;

	ASSERT(m_pParameter != NULL);
	
	if(!strValue.IsEmpty())
		vtVal.vt = VT_BSTR;
	else
		vtVal.vt = VT_NULL;

	//Corrected by Giles Forster 10/03/2001
	vtVal.bstrVal = strValue.AllocSysString();
	//vtVal.SetString(strValue.GetBuffer(0));

	try
	{
		if(m_pParameter->Size == 0)
			m_pParameter->Size = sizeof(char) * strValue.GetLength();

		m_pParameter->Value = vtVal;
		::SysFreeString(vtVal.bstrVal);
		return TRUE;
	}
	catch(_com_error &e)
	{
		dump_com_error(e);
		::SysFreeString(vtVal.bstrVal);
		return FALSE;
	}
}
开发者ID:zxlooong,项目名称:minica,代码行数:31,代码来源:ado2.cpp


示例6: Close

BOOL CADODatabase::Open(LPCTSTR lpstrConnection, LPCTSTR lpstrUserID, LPCTSTR lpstrPassword)
{
	HRESULT hr = S_OK;

	if(IsOpen())
		Close();

	if(strcmp(lpstrConnection, _T("")) != 0)
		m_strConnection = lpstrConnection;

	ASSERT(!m_strConnection.IsEmpty());

	try
	{
		if(m_nConnectionTimeout != 0)
			m_pConnection->PutConnectionTimeout(m_nConnectionTimeout);
		hr = m_pConnection->Open(_bstr_t(m_strConnection), _bstr_t(lpstrUserID), _bstr_t(lpstrPassword), NULL);
		return hr == S_OK;
	}
	catch(_com_error &e)
	{
		dump_com_error(e);
		return FALSE;
	}
	
}
开发者ID:zxlooong,项目名称:minica,代码行数:26,代码来源:ado2.cpp


示例7: while

BOOL CADORecordset::GetChunk(FieldPtr pField, CString& strValue)
{
	CString str;
	long lngSize, lngOffSet = 0;
	_variant_t varChunk;

	lngSize = pField->ActualSize;		//Á㤶È
	
	str.Empty();
	while(lngOffSet < lngSize)
	{ 
		try
		{
			varChunk = pField->GetChunk(ChunkSize);
			
			str += varChunk.bstrVal;
			lngOffSet += ChunkSize;
		}
		catch(_com_error &e)
		{
			dump_com_error(e);
			return FALSE;
		}
	}

	lngOffSet = 0;
	strValue = str;
	return TRUE;
}
开发者ID:zxlooong,项目名称:minica,代码行数:29,代码来源:ado2.cpp


示例8: switch

BOOL CADORecordset::GetFieldValue(int nIndex, SYSTEMTIME& time)
{
	_variant_t  vtFld;
	_variant_t  vtIndex;
    DOUBLE      vt;
	vtIndex.vt = VT_I2;
	vtIndex.iVal = nIndex;
	
	try
	{
		vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value;
		switch(vtFld.vt) 
		{
		case VT_DATE:
			{
                vt = vtFld.date;
                VariantTimeToSystemTime(vt,&time);
			}
			break;
		case VT_EMPTY:
		case VT_NULL:
            memset(&time,0,sizeof(SYSTEMTIME));
			/*time.SetStatus(COleDateTime::null);**/
			break;
		default:
			return FALSE;
		}
		return TRUE;
	}
	catch(_com_error &e)
	{
		dump_com_error(e);
		return FALSE;
	}
}
开发者ID:lidongqiang,项目名称:wvpctool,代码行数:35,代码来源:ado2.cpp


示例9: UpdateParamFromDB

BOOL CRDB::LoadParamFromDB(CString sDeviceType)
{

	BOOL bResult = TRUE;
	HRESULT hr= S_OK;
	//CString strSQL;
	try
	{ 
		if(pRsDev->State==adStateClosed)
		{
			strSQL.Format(_T("select * from %s"),sDeviceType); 
			hr = pRsDev->Open(strSQL.AllocSysString(),
				theApp.pConn.GetInterfacePtr(),
				adOpenStatic,
				adLockOptimistic,
				-1);
			if (pRsDev->RecordCount>0)
			{
				pRsDev->MoveFirst(); 
			}
		} 
		bResult = UpdateParamFromDB(); 
	}
	catch(_com_error &e)
	{
		bResult = FALSE;
		e.ErrorMessage();
		dump_com_error(e);
	}  
	return bResult;
}
开发者ID:eseawind,项目名称:CoalQualityTestSystem,代码行数:31,代码来源:RDB.cpp


示例10: ASSERT

BOOL CADOParameter::SetValue(wstring strValue)
{
	_variant_t vtVal;

	ASSERT(m_pParameter != NULL);
	
    if(!strValue.empty())
		vtVal.vt = VT_BSTR;
	else
		vtVal.vt = VT_NULL;

    vtVal.bstrVal = _bstr_t(strValue.c_str());

	try
	{
		if(m_pParameter->Size == 0)
            m_pParameter->Size = sizeof(char) * strValue.length();

		m_pParameter->Value = vtVal;
		::SysFreeString(vtVal.bstrVal);
		return TRUE;
	}
	catch(_com_error &e)
	{
		dump_com_error(e);
		::SysFreeString(vtVal.bstrVal);
		return FALSE;
	}
}
开发者ID:lidongqiang,项目名称:wvpctool,代码行数:29,代码来源:ado2.cpp


示例11: TESTHR

void CLryEDBQryDoc::OnDeleteRecord() 
{ 
	
	HRESULT hr; 
	try
	{ 
			if((theApp.UserInfo.bLogon()== TRUE)&&
			(ID_OK==MessageBox(NULL,_T("确认删除记录吗?"),_T("警告!"),MB_OKCANCEL+MB_ICONWARNING+MB_TASKMODAL)))
			{
				pObj.RowNO = Rs->AbsolutePosition-1;
 				hr = Rs->Delete(adAffectCurrent); 			
				TESTHR(hr); 				
				hr = Rs->Update();					
				TESTHR(hr);	
				
				hr = MoveNext();
				TESTHR(hr); 
				//hr = MovePrevious();
				//TESTHR(hr); 
				UpdateAllViews(NULL,2,&pObj);	
							
			}

	}
	catch(_com_error &e)
	{
		dump_com_error(e);
	}	
}
开发者ID:eseawind,项目名称:CoalQualityTestSystem,代码行数:29,代码来源:LryEDBQryDoc.cpp


示例12: switch

void CLryEDBQryDoc::OnCursorMove(UINT nID)
{
	try
	{
		switch(nID)
		{
		case ID_RECORD_FIRST:		
			MoveFirst();
			break;
		case ID_RECORD_PREV:
			MovePrevious();
			break;
		case ID_RECORD_NEXT:
			MoveNext();
			break;
		case ID_RECORD_LAST:
			MoveLast();
			break;
		default: break;
		} 
	}
	catch(_com_error &e)
	{
		dump_com_error(e);
	}
	UpdateAllViews(	NULL,1);
}
开发者ID:eseawind,项目名称:CoalQualityTestSystem,代码行数:27,代码来源:LryEDBQryDoc.cpp


示例13: AfxMessageBox

void CPointArrayView::OnUpdate()
{
	if (UpdateData() != TRUE)
		return;

	int nSel = m_ctlList.GetCurSel();
	if (nSel == LB_ERR)
	{
		AfxMessageBox(IDS_SELECT_POINT_TO_BE_UPDATED);
		return;
	}

	// Replace the point in the CArray of CPoints.
	CPoint pt(m_x, m_y);
	try {
	GetDocument()->m_ptArray->Array[nSel] = pt;
	} catch(_com_error& e) {
		dump_com_error(e);
	}

	// Update the old point in the listbox by removing
	// the old entry and adding a new entry.
	m_ctlList.DeleteString(nSel);
	AddPointToListBox(pt, nSel);
}
开发者ID:jetlive,项目名称:skiaming,代码行数:25,代码来源:ptarryvw.cpp


示例14: switch

BOOL CADORecordset::GetFieldValue(int nIndex, double& dbValue)
{	
	double val = (double)NULL;
	_variant_t vtFld;
	_variant_t vtIndex;

	vtIndex.vt = VT_I2;
	vtIndex.iVal = nIndex;
	int nTempScale ;
	
	try
	{
		vtFld = m_pRecordset->Fields->GetItem(vtIndex)->Value;
		switch(vtFld.vt)
		{
		case VT_R4:
			val = vtFld.fltVal;
			break;
		case VT_R8:
			val = vtFld.dblVal;
			break;
		case VT_DECIMAL:
			//Corrected by Jos?Carlos Mart韩ez Gal醤
			val = vtFld.decVal.Lo32;
			val *= (vtFld.decVal.sign == 128)? -1 : 1;
			nTempScale = vtFld.decVal.scale ;
			val /= pow((long double)10, nTempScale); 
			break;
		case VT_UI1:
			val = vtFld.iVal;
			break;
		case VT_I2:
		case VT_I4:
			val = vtFld.lVal;
			break;
		case VT_INT:
			val = vtFld.intVal;
			break;
		case VT_CY:   //Added by John Andy Johnson!!!!
			vtFld.ChangeType(VT_R8);
			val = vtFld.dblVal;
			break;
		case VT_NULL:
		case VT_EMPTY:
			val = 0;
			break;
		default:
			val = 0;
		}
		dbValue = val;
		return TRUE;
	}
	catch(_com_error &e)
	{
		dump_com_error(e);
		return FALSE;
	}
}
开发者ID:vizcount,项目名称:work,代码行数:58,代码来源:ado2.cpp


示例15: GetDocument

void CIntListView::OnRemoveAll()
{
	try {
	// Remove all of the integers from the CList<int,int>.
	GetDocument()->m_intList->RemoveAll();
	} catch(_com_error& e) {
		dump_com_error(e);
	}

	// Remove all of the integers from the listbox.
	m_ctlList.ResetContent();
}
开发者ID:Jinjiego,项目名称:VCSamples,代码行数:12,代码来源:intlstvw.cpp


示例16: GetDocument

void CPointArrayView::OnRemoveAll()
{
	try {
	// Remove all of the points from the CArray of CPoints.
	GetDocument()->m_ptArray->RemoveAll();
	} catch(_com_error& e) {
		dump_com_error(e);
	}

	// Remove all of the points from the listbox.
	m_ctlList.ResetContent();
}
开发者ID:jetlive,项目名称:skiaming,代码行数:12,代码来源:ptarryvw.cpp


示例17: catch

HRESULT CLryEDBQryDoc::MoveLast()
{
	HRESULT hr= S_OK;
	try
	{
		hr = Rs->MoveLast(); //MoveLast 不设置adoEOF标志?
	}
	catch(_com_error &e)
	{
			dump_com_error(e);
	}			
	return hr;
}
开发者ID:eseawind,项目名称:CoalQualityTestSystem,代码行数:13,代码来源:LryEDBQryDoc.cpp


示例18: catch

BOOL CADORecordset::GetFieldValue(LPCTSTR lpFieldName, _variant_t& vtValue)
{
	try
	{
		vtValue = m_pRecordset->Fields->GetItem(lpFieldName)->Value;
		return TRUE;
	}
	catch(_com_error &e)
	{
		dump_com_error(e);
		return FALSE;
	}
}
开发者ID:zxlooong,项目名称:minica,代码行数:13,代码来源:ado2.cpp


示例19: Close

BOOL CADORecordset::Open(_ConnectionPtr mpdb, LPCTSTR lpstrExec, int nOption)
{	
    Close();
 
    if(_tcscmp(lpstrExec, _T("")) != 0)
        m_strQuery = lpstrExec;

    ASSERT(!m_strQuery.empty());

    if(m_pConnection == NULL)
        m_pConnection = mpdb;

    LTrim(m_strQuery);

    BOOL bIsSelect = m_strQuery.substr(0,_tcslen(_T("select "))).compare(_T("select ")) == 0 && nOption == openUnknown;
    try {
        m_pRecordset->CursorType        = adOpenStatic;
        m_pRecordset->CursorLocation    = adUseClient;
        if(bIsSelect || nOption == openQuery || nOption == openUnknown) {
            m_pRecordset->Open(m_strQuery.c_str(),
                _variant_t((IDispatch*)mpdb,
                TRUE),
                adOpenStatic,
                adLockOptimistic,
                adCmdUnknown);

        } else if(nOption == openTable) {
            m_pRecordset->Open(m_strQuery.c_str(),
                _variant_t((IDispatch*)mpdb,
                TRUE),
                adOpenKeyset,
                adLockOptimistic,
                adCmdTable);

        } else if(nOption == openStoredProc) {
            m_pCmd->ActiveConnection        = mpdb;
            m_pCmd->CommandText             = _bstr_t(m_strQuery.c_str());
            m_pCmd->CommandType             = adCmdStoredProc;
            m_pConnection->CursorLocation   = adUseClient;
            m_pRecordset = m_pCmd->Execute(NULL, NULL, adCmdText);
        } else {
            TRACE( _T("Unknown parameter. %d"), nOption);
            return FALSE;
        }
    } catch(_com_error &e) {
        dump_com_error(e);
        return FALSE;
    }
    return m_pRecordset != NULL && m_pRecordset->GetState()!= adStateClosed;
}
开发者ID:lidongqiang,项目名称:wvpctool,代码行数:50,代码来源:ado2.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dump_digest函数代码示例发布时间:2022-05-30
下一篇:
C++ dump函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap