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

C++ CheckHr函数代码示例

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

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



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

示例1: AssertPtr

void SampleInterface::CreateCom(IUnknown *punkCtl, REFIID riid, void ** ppv)
{
	AssertPtr(ppv);
	Assert(!*ppv);
	if (punkCtl)
		ThrowHr(WarnHr(CLASS_E_NOAGGREGATION));

	ComSmartPtr<SampleInterface> qxsi;
	qxsi.Attach(NewObj SampleInterface());		// ref count initialy 1
	CheckHr(qxsi->QueryInterface(riid, ppv));
}
开发者ID:FieldDB,项目名称:FieldWorks,代码行数:11,代码来源:SampleInterface.cpp


示例2: AssertPtr

void RomRenderEngine::CreateCom(IUnknown *punkCtl, REFIID riid, void ** ppv)
{
	AssertPtr(ppv);
	Assert(!*ppv);
	if (punkCtl)
		ThrowHr(WarnHr(CLASS_E_NOAGGREGATION));

	ComSmartPtr<RomRenderEngine> qrre;
	qrre.Attach(NewObj RomRenderEngine());		// ref count initialy 1
	CheckHr(qrre->QueryInterface(riid, ppv));
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:11,代码来源:RomRenderEngine.cpp


示例3: AssertPtr

void LgKeymanHandler::CreateCom(IUnknown *punkCtl, REFIID riid, void ** ppv)
{
	AssertPtr(ppv);
	Assert(!*ppv);
	if (punkCtl)
		ThrowHr(WarnHr(CLASS_E_NOAGGREGATION));

	ComSmartPtr<LgKeymanHandler> qlkh;
	qlkh.Attach(NewObj LgKeymanHandler());		// ref count initialy 1
	CheckHr(qlkh->QueryInterface(riid, ppv));
}
开发者ID:agran147,项目名称:FieldWorks,代码行数:11,代码来源:LgKeymanHandler.cpp


示例4: AssertPtr

/*----------------------------------------------------------------------------------------------
	Static method to create an instance of FwDbMergeStyles.
----------------------------------------------------------------------------------------------*/
void FwDbMergeStyles::CreateCom(IUnknown *punkCtl, REFIID riid, void ** ppv)
{
	AssertPtr(ppv);
	Assert(!*ppv);
	if (punkCtl)
		ThrowHr(WarnHr(CLASS_E_NOAGGREGATION));

	ComSmartPtr<FwDbMergeStyles> qzfwst;
	qzfwst.Attach(NewObj FwDbMergeStyles());	// ref count initially 1
	CheckHr(qzfwst->QueryInterface(riid, ppv));
}
开发者ID:agran147,项目名称:FieldWorks,代码行数:14,代码来源:FwDbMergeStyles.cpp


示例5: MakeTextSelection

void ViewTest2::TestMakeTextSelection()
{
	VwSelLevInfo vsli;
	vsli.ihvo=-1;
	vsli.cpropPrevious = 0;
	vsli.tag = kflidStText_Paragraphs;

	m_psts->Output("  FUNCTION: MakeTextSelection(0, 1, &vsli, kflidStTxtPara_Contents, 0, 5, "
					"25, 0, false, 2))\n");
	CheckHr(m_qrootb->MakeTextSelection(0, 1, &vsli, kflidStTxtPara_Contents, 0, 5, 25, 0,
					false, 2));

	m_psts->Output("\n	Now Testing DestroySelection()\n");
	CheckHr(m_qrootb->DestroySelection());

	m_psts->Output("  FUNCTION: MakeTextSelection(0, 1, &vsli, kflidStTxtPara_Contents, 0, 5, "
					"25, 0, false, 0))\n");
	CheckHr(m_qrootb->MakeTextSelection(0, 1, &vsli, kflidStTxtPara_Contents, 0, 5, 25, 0,
			false, 0));
	m_psts->Output("  FUNCTION: MakeTextSelection(0, 1, &vsli, kflidStTxtPara_Contents, 0, 5, "
					"25, 0, false, 0))\n");
	CheckHr(m_qrootb->MakeTextSelection(0, 1, &vsli, kflidStTxtPara_Contents, 0, 5, 25, 0,
			false, 0));

	m_psts->Output("MULTIPLE ENTRY");
	m_psts->Output("  FUNCTION: MakeTextSelection(0, 1, &vsli, kflidStTxtPara_Contents, 0, 25, "
					"75, 0, false, 1))\n");
	CheckHr(m_qrootb->MakeTextSelection(0, 1, &vsli, kflidStTxtPara_Contents, 0, 25, 75, 0,
			false, 1));
	m_psts->Output("  FUNCTION: MakeTextSelection(0, 1, &vsli, kflidStTxtPara_Contents, 0, 5, "
					"25, 0, false, -1))\n");
	CheckHr(m_qrootb->MakeTextSelection(0, 1, &vsli, kflidStTxtPara_Contents, 0, 5, 25, 0,
			false, -1));
}
开发者ID:agran147,项目名称:FieldWorks,代码行数:34,代码来源:ViewTest.cpp


示例6: AssertPtrN

/*----------------------------------------------------------------------------------------------
	Set the text of the control to be equal to ptss. If ptss is NULL, the edit box is cleared.
	Message: FW_EM_SETTEXT.
----------------------------------------------------------------------------------------------*/
void TssEdit::SetText(ITsString * ptss)
{
	AssertPtrN(ptss); // NULL can be used to clear string.
	Assert(m_qcda);

	ITsStringPtr qtss = ptss;
	if (!ptss)
	{
		ITsStrFactoryPtr qtsf;
		qtsf.CreateInstance(CLSID_TsStrFactory);
		CheckHr(qtsf->MakeStringRgch(L"", 0, m_wsBase, &qtss));
	}
	ITsStringPtr qtssOld;
	CheckHr(m_qcda->get_StringProp(khvoString, ktagString, &qtssOld));
	int cchOld;
	CheckHr(qtssOld->get_Length(&cchOld));
	CheckHr(m_qcda->CacheStringProp(khvoString, ktagString, qtss));
	int cchNew;
	CheckHr(qtss->get_Length(&cchNew));
	// Pretend the whole length has been deleted and the whole new inserted.
	CheckHr(m_qcda->PropChanged(NULL, kpctNotifyAll, khvoString, ktagString, 0, cchNew, cchOld));
	OnUpdate();
	::UpdateWindow(m_hwnd);
	OnChange();
}
开发者ID:FieldDB,项目名称:FieldWorks,代码行数:29,代码来源:TssEdit.cpp


示例7: AssertPtr

void DebugReport::CreateCom(IUnknown *punkCtl, REFIID riid, void ** ppv)
{
	AssertPtr(ppv);
	Assert(!*ppv);
	if (punkCtl)
	{
		ThrowHr(WarnHr(CLASS_E_NOAGGREGATION));
	}
	ComSmartPtr<DebugReport> qdbr;
	// Ref count initially 1
	qdbr.Attach(NewObj DebugReport());
	CheckHr(qdbr->QueryInterface(riid, ppv));
}
开发者ID:agran147,项目名称:FieldWorks,代码行数:13,代码来源:DebugReport.cpp


示例8: AssertPtr

void ActionHandler::CreateCom(IUnknown *punkCtl, REFIID riid, void ** ppv)
{
	AssertPtr(ppv);
	Assert(!*ppv);
	if (punkCtl)
	{
		ThrowHr(WarnHr(CLASS_E_NOAGGREGATION));
	}
	ComSmartPtr<ActionHandler> qzacth;
	// Ref count initially 1
	qzacth.Attach(NewObj ActionHandler());
	CheckHr(qzacth->QueryInterface(riid, ppv));
}
开发者ID:agran147,项目名称:FieldWorks,代码行数:13,代码来源:ActionHandler.cpp


示例9: Assert

/*----------------------------------------------------------------------------------------------
	Selects a range of characters.
	Message: EM_SETSEL.
----------------------------------------------------------------------------------------------*/
void TssEdit::SetSel(int ichAnchor, int ichEnd)
{
	Assert(m_qrootb);

	int cch = 0;
	ITsStringPtr qtss;
	CheckHr(m_qcda->get_StringProp(khvoString, ktagString, &qtss));
	if (qtss)
		CheckHr(qtss->get_Length(&cch));
	if (ichAnchor < 0)
		ichAnchor = cch;
	if (ichEnd < 0)
		ichEnd = cch;
	if (ichAnchor > cch)
		ichAnchor = cch;
	// This can happen; apparently when a tab brings the focus to this window, Windows passes
	// a large number rather than -1 to set the end of the range.
	if (ichEnd > cch)
		ichEnd = cch;
	CheckHr(m_qrootb->MakeTextSelection(0, 0, NULL, ktagString, 0, ichAnchor, ichEnd, 0, true,
		-1, NULL, true, NULL));
}
开发者ID:FieldDB,项目名称:FieldWorks,代码行数:26,代码来源:TssEdit.cpp


示例10: StrUni

void ViewTest2::WrapOnTyping(char *pchinput, int _cchBackspace, int _cchDelForward,
							 char *_chFirst, RECT _rcSrc, RECT _rcDst)
{
	OLECHAR oleChar = _chFirst[0];
	SmartBstr _bstrInput = StrUni(pchinput).Bstr();

	m_psts->OutputFormat("  FUNCTION: OnTyping(m_qvg, \"%s\", %d, %d, '%s', {%d,%d,%d,%d}, "
		"{%d,%d,%d,%d})\n", pchinput, _cchBackspace, _cchDelForward, _chFirst, _rcSrc.left,
		_rcSrc.top, _rcSrc.right, _rcSrc.bottom, _rcDst.left, _rcDst.top, _rcDst.right,
		_rcDst.bottom);
	CheckHr(m_qrootb->OnTyping(m_qvg, _bstrInput, _cchBackspace, _cchDelForward, oleChar,
		_rcSrc, _rcDst));
}
开发者ID:agran147,项目名称:FieldWorks,代码行数:13,代码来源:ViewTest.cpp


示例11: Failure

void ViewTest1::TestGuid()
{
	OLECHAR rgchGuid[9] = L"B8A6E680";
	OLECHAR rgchGuid2[9];

	// Send NULL pointers
	HRESULT hr = m_qxvoTest->put_Guid(NULL);
	if (!FAILED(hr))
		Failure("Call to function put_Guid(NULL) should have returned an error");

	hr = m_qxvoTest->get_Guid(NULL);
	if (!FAILED(hr))
		Failure("Call to function get_Guid(NULL) should have returned an error");

	// Valid test
	CheckHr(m_qxvoTest->put_Guid(rgchGuid));
	CheckHr(m_qxvoTest->get_Guid(rgchGuid2));

	// Compare the two guids and report, result should be > or < 0
	if (wcscmp(rgchGuid, rgchGuid2))
		Failure("Guid function returned wrong result");
}
开发者ID:agran147,项目名称:FieldWorks,代码行数:22,代码来源:ViewTest.cpp


示例12: CheckHr

/*----------------------------------------------------------------------------------------------
	Return the size of the text, in points.
	Not part of ITextSource interface; specific to FwGrTxtSrc.
----------------------------------------------------------------------------------------------*/
float FwGrTxtSrc::GetFontSize(int ich)
{
	LgCharRenderProps lgchrp;
	int ichMinBogus, ichLimBogus;
	GrResult res = (GrResult)m_qts->GetCharProps(ich, &lgchrp, &ichMinBogus, &ichLimBogus);

	int dympHeight = lgchrp.dympHeight;
	if(lgchrp.ssv != kssvOff)
	{
		// psuedo device context works since we are getting proportions which are invariant
		HDC hdc = ::CreateDC(TEXT("DISPLAY"),NULL,NULL,NULL);

		IVwGraphicsWin32Ptr qvgW;
		qvgW.CreateInstance(CLSID_VwGraphicsWin32);
		qvgW->Initialize(hdc);

		IVwGraphicsPtr qvg;
		CheckHr(qvgW->QueryInterface(IID_IVwGraphics, (void **) &qvg));
		CheckHr(qvg->SetupGraphics(&lgchrp));

		int dSizeNumerator = 1;
		int dSizeDenominator = 1;
		if (lgchrp.ssv == kssvSuper)
		{
			CheckHr(qvg->GetSuperscriptHeightRatio(&dSizeNumerator, &dSizeDenominator));
		}
		else if (lgchrp.ssv == kssvSub)
		{
			CheckHr(qvg->GetSubscriptHeightRatio(&dSizeNumerator, &dSizeDenominator));
		}
		dympHeight = gr::GrEngine::GrIntMulDiv(dympHeight, dSizeNumerator, dSizeDenominator);

		qvgW.Clear();
		qvg.Clear();
		::DeleteDC(hdc);
	}

	return (float)(dympHeight / 1000);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:43,代码来源:FwGr.cpp


示例13: main

int main(int argc, char** argv)
{
	try
	{
#ifdef WIN32
		DllMain(0, DLL_PROCESS_ATTACH, 0);
#endif

		IClassFactory* pFact = 0;
		CheckHr(DllGetClassObject(CLSID_TestGenericFactory, IID_IClassFactory, (void**)&pFact));

		IUnknown* pTest = 0;
		CheckHr(pFact->CreateInstance(0, IID_IUnknown, (void**)&pTest));

		pFact->Release();
		pTest->Release();

#ifdef WIN32
		return DllMain(0, DLL_PROCESS_DETACH, 0) ? 0 : 1;
#else
		return 0;
#endif
	}
	catch (Throwable& thr)
	{
		std::cerr << "Failed HRESULT: " << thr.Error() << "\n";
	}
	catch (std::exception& e)
	{
		std::cerr << "Exception: " << e.what() << "\n";
	}
	catch (...)
	{
		std::cerr << "Unknown Exception:\n";
	}

	return 2;
}
开发者ID:FieldDB,项目名称:FieldWorks,代码行数:38,代码来源:TestGenericFactory.cpp


示例14: CheckHr

/*----------------------------------------------------------------------------------------------
	${IActionHandler#Rollback}
----------------------------------------------------------------------------------------------*/
STDMETHODIMP ActionHandler::Rollback(int nDepth)
{
	BEGIN_COM_METHOD;
	if (m_nDepth > 0)
	{
		CheckHr(EndUndoTask());
		m_nDepth = nDepth;
		// make sure we have something to undo
		if (m_iCurrSeq >= 0 && m_fDataChangeAction)
		{
			UndoResult ures;
			CheckHr(Undo(&ures));
			// REVIEW (TimS): What should we do if the undo fails?
			if (ures == kuresError || ures == kuresFailed)
			{
				return E_FAIL;
			}
			CleanUpRedoActions(true);
		}
	}
	return S_OK;
	END_COM_METHOD(g_factActh, IID_IActionHandler);
}
开发者ID:agran147,项目名称:FieldWorks,代码行数:26,代码来源:ActionHandler.cpp


示例15: AssertPtr

/*----------------------------------------------------------------------------------------------
	Replace the current selection with the specified text.
	Message: FW_EM_REPLACESEL.
----------------------------------------------------------------------------------------------*/
void TssEdit::ReplaceSel(ITsString * ptss)
{
	AssertPtr(ptss);
	AssertPtr(m_qrootb);

	IVwSelectionPtr qvwsel;
	CheckHr(m_qrootb->get_Selection(&qvwsel));
	if (!qvwsel)
	{
		// If there's not a selection, try to create one at the beginning of the string!
		CheckHr(m_qrootb->MakeTextSelection(0, 0, NULL, ktagString, 0, 0, 0, 0, true, -1, NULL,
			true, &qvwsel));
		if (!qvwsel)
			return;
	}
	CheckHr(qvwsel->ReplaceWithTsString(ptss));

	// ReplaceWithTsString should handle this (JohnT, 8-22-01).
	//CheckHr(m_qcda->PropChanged(NULL, kpctNotifyAll, khvoString, ktagString, 0, 0, 0));
	OnUpdate();
	::UpdateWindow(m_hwnd);
	OnChange();
}
开发者ID:FieldDB,项目名称:FieldWorks,代码行数:27,代码来源:TssEdit.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ CheckInRoom函数代码示例发布时间:2022-05-30
下一篇:
C++ CheckGLError函数代码示例发布时间: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