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


C++ LPADRBOOK::CompareEntryIDs方法代码示例

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


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

示例1: OnCompareEntryIDs

void CBaseDialog::OnCompareEntryIDs()
{
	HRESULT			hRes = S_OK;
	if (!m_lpMapiObjects) return;

	LPMDB			lpMDB = m_lpMapiObjects->GetMDB(); // do not release
	LPMAPISESSION	lpMAPISession = m_lpMapiObjects->GetSession(); // do not release
	LPADRBOOK		lpAB = m_lpMapiObjects->GetAddrBook(false); // do not release

	CEditor MyEIDs(
		this,
		IDS_COMPAREEIDS,
		IDS_COMPAREEIDSPROMPTS,
		4,
		CEDITOR_BUTTON_OK | CEDITOR_BUTTON_CANCEL);

	MyEIDs.InitPane(0, CreateSingleLinePane(IDS_EID1, NULL, false));
	MyEIDs.InitPane(1, CreateSingleLinePane(IDS_EID2, NULL, false));

	UINT uidDropDown[] = {
		IDS_DDMESSAGESTORE,
		IDS_DDSESSION,
		IDS_DDADDRESSBOOK
	};
	MyEIDs.InitPane(2, CreateDropDownPane(IDS_OBJECTFORCOMPAREEID, _countof(uidDropDown), uidDropDown, true));

	MyEIDs.InitPane(3, CreateCheckPane(IDS_EIDBASE64ENCODED, false, false));

	WC_H(MyEIDs.DisplayDialog());
	if (S_OK != hRes) return;

	if ((0 == MyEIDs.GetDropDown(2) && !lpMDB) ||
		(1 == MyEIDs.GetDropDown(2) && !lpMAPISession) ||
		(2 == MyEIDs.GetDropDown(2) && !lpAB))
	{
		ErrDialog(__FILE__, __LINE__, IDS_EDCOMPAREEID);
		return;
	}
	// Get the entry IDs as a binary
	LPENTRYID lpEntryID1 = NULL;
	size_t cbBin1 = NULL;
	EC_H(MyEIDs.GetEntryID(0, MyEIDs.GetCheck(3), &cbBin1, &lpEntryID1));

	LPENTRYID lpEntryID2 = NULL;
	size_t cbBin2 = NULL;
	EC_H(MyEIDs.GetEntryID(1, MyEIDs.GetCheck(3), &cbBin2, &lpEntryID2));

	ULONG ulResult = NULL;
	switch (MyEIDs.GetDropDown(2))
	{
	case 0: // Message Store
		EC_MAPI(lpMDB->CompareEntryIDs((ULONG)cbBin1, lpEntryID1, (ULONG)cbBin2, lpEntryID2, NULL, &ulResult));
		break;
	case 1: // Session
		EC_MAPI(lpMAPISession->CompareEntryIDs((ULONG)cbBin1, lpEntryID1, (ULONG)cbBin2, lpEntryID2, NULL, &ulResult));
		break;
	case 2: // Address Book
		EC_MAPI(lpAB->CompareEntryIDs((ULONG)cbBin1, lpEntryID1, (ULONG)cbBin2, lpEntryID2, NULL, &ulResult));
		break;
	}

	if (SUCCEEDED(hRes))
	{
		CString szRet;
		CString szResult;
		EC_B(szResult.LoadString(ulResult ? IDS_TRUE : IDS_FALSE));
		szRet.FormatMessage(IDS_COMPAREEIDBOOL, ulResult, szResult);

		CEditor Result(
			this,
			IDS_COMPAREEIDSRESULT,
			NULL,
			(ULONG)0,
			CEDITOR_BUTTON_OK);
		Result.SetPromptPostFix(szRet);
		(void)Result.DisplayDialog();
	}

	delete[] lpEntryID2;
	delete[] lpEntryID1;
} // CBaseDialog::OnCompareEntryIDs
开发者ID:JasonSchlauch,项目名称:mfcmapi,代码行数:81,代码来源:BaseDialog.cpp


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