I am using following code for querying interfaces.
HResult hr = MAPILogonEx ( NULL, (LPTSTR)lpcszProfile, (LPTSTR) Password,
MAPI_EXTENDED|MAPI_UNICODE|MAPI_NEW_SESSION|MAPI_NO_MAIL|MAPI_TIMEOUT_SHORT,
&m_pSession );
CByteArray baEntryID;
LPMAPITABLE pMsgStoresTable;
hr = pSession->GetMsgStoresTable ( 0, &pMsgStoresTable );
bool bFoundEntryID = false;
if (SUCCEEDED ( hr ) )
{
static const SizedSPropTagArray ( 3L, spta ) =
{ 3L, { PR_DISPLAY_NAME_A, PR_ENTRYID, PR_MDB_PROVIDER } };
LPSRowSet lprs;
hr = HrQueryAllRows ( pMsgStoresTable, (LPSPropTagArray) &spta, NULL, NULL,
0, &lprs );
if ( SUCCEEDED ( hr ) )
{
//Hunt for the one of interest (or present dialog for user to choose)
for ( ULONG nIdx = 0; nIdx < lprs->cRows && ! bFoundEntryID; nIdx++ )
{
SRow& ThisRow = lprs->aRow[nIdx];
SPropValue& DisplayNameProp = ThisRow.lpProps[0];
SPropValue& EntryIDProp = ThisRow.lpProps[1];
SPropValue& ProviderIDProp = ThisRow.lpProps[2];
LPSTR lpszDisplayName = DisplayNameProp.Value.lpszA;
SBinary binEntryID = EntryIDProp.Value.bin;
SBinary binProviderID = ProviderIDProp.Value.bin;
//check the provider ID to see if it is MS-Exchange based
if ( sizeof(GUID) == binProviderID.cb ) //
{
if ( 0 == memcmp ( binProviderID.lpb, pbExchangeProviderPrimaryUserGuid,
sizeof(GUID) ) ||
0 == memcmp ( binProviderID.lpb, pbExchangeProviderDelegateGuid,
sizeof(GUID) ) ||
0 == memcmp ( binProviderID.lpb, pbExchangeProviderPublicGuid,
sizeof(GUID) ) ||
0 == memcmp ( binProviderID.lpb, pbExchangeProviderXportGuid,
sizeof(GUID) ) )
{
baEntryID.SetSize ( binEntryID.cb );
CopyMemory ( baEntryID.GetData(), binEntryID.lpb, binEntryID.cb );
bFoundEntryID = true;
}
}
}
}
}
if (bFoundEntryID)
{
LPMDB pMsgStore = NULL;
hr = m_pSession->OpenMsgStore ( NULL, baEntryID.GetSize(), (LPENTRYID)
baEntryID.GetData(),
&IID_IMsgStore, MDB_NO_DIALOG|MDB_NO_MAIL, &pMsgStore );
if ( (SUCCEEDED ( m_hr )) || ( m_hr == MAPI_W_ERRORS_RETURNED && pMsgStore)
)
{
hr = pMsgStore->QueryInterface(IID_IExchangeManageStore4, (void **)
&m_pExMgStore);
// here I get E_NOINTERFACE
}
}
I am using outlook 2007 profile and ESMMDB32.dll of version 12.0.6211.1000.
Please help me to resolve this problem of IID_IExchangeManageStore4.
Thanks in advanced
url:http://www.ureader.com/gp/1173-1.aspx
Dmitry Streblechenko - 18 Jul 2008 18:33 GMT
AFAIK IExchangeManageStore4 is only supported by the Exchange version of
MAPI:
http://www.microsoft.com/downloads/details.aspx?FamilyID=e17e7f31-079a-43a9-bff2
-0a110307611e&DisplayLang=en
The client version of MAPI does not support it.

Signature
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
>I am using following code for querying interfaces.
>
[quoted text clipped - 71 lines]
>
> url:http://www.ureader.com/gp/1173-1.aspx