本文整理汇总了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