Discussion:
Reading shared calendars using extended MAPI
(too old to reply)
dev
15 years ago
Permalink
I'm trying to use (extended) MAPI to read the contents of a shared
calendar.
Using the Outlook objects, it's easy :

_NameSpace olNs( olApp.GetNamespace("MAPI") );
...
Recipient olRecipient =
olNs.CreateRecipient( (LPCTSTR)szSharedCalendarName );
if ( olRecipient.Resolve() )
{
MAPIFolder olFolder = olNs.GetSharedDefaultFolder(olRecipient,
olFolderCalendar);
_Items olItems = olFolder.GetItems();

but I can't find any information on doing the same thing in Extended
MAPI.
I can get my own calendar no problem :

LPMAPIFOLDER lpInbox = NULL;
hr = m_pMessageStore->GetReceiveFolder(NULL, 0, &cbEntryID,
&lpEntryID, NULL );
if (FAILED(hr)) return hr;
hr = m_pMessageStore->OpenEntry( cbEntryID, lpEntryID, NULL,
MAPI_MODIFY,
&ulObjType, (LPUNKNOWN FAR
*)&lpInbox );
if (FAILED(hr)) return hr;
hr = HrGetOneProp( (LPMAPIPROP)lpInbox, PR_IPM_APPOINTMENT_ENTRYID,
&pPropValue );
if (FAILED(hr)) return hr;
hr = m_pMessageStore->OpenEntry( pPropValue->Value.bin.cb,
(ENTRYID*)pPropValue->Value.bin.lpb,
NULL, MAPI_MODIFY, &ulObjType,
(IUnknown**)&lpFolder );
if (ulObjType != MAPI_FOLDER) // must be a folder
return E_FAIL;
// read the contents of the folder
etc.

But how do I access a shared calendar ?
(I can't seem to find any examples on the web, which surprises me)

Regards,
Tim Dale, BRE

***@cav_en_dish.c_o.u_k
(remove all underscores to email directly)
dev
15 years ago
Permalink
Post by dev
I'm trying to use (extended) MAPI to read the contents of a shared
calendar.
...
Post by dev
Regards,
Tim Dale, BRE
(remove all underscores to email directly)
I tried using the approach of the IExchange functions but couldn't get
my project to link without
the presence of MFC40.LIB, which I can't find anywhere at the moment,
and don't really
want to start messing around with.
I was wondering if there was a way of doing this without using the
IExchange functions.
However, if IExchangeManageStor, etc. is the only way to go, does
anyone know how to link
in Exchsdk.lib without having to use old out-of-date library files ?
I downloaded the Exchange 2007 SDK but it has completely different
library files.

Regards, Tim Dale, BRE
Dmitry Streblechenko
15 years ago
Permalink
Why would using IExchangeManageStore etc require any libraries? These are
just static interface definitions.
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Post by dev
I'm trying to use (extended) MAPI to read the contents of a shared
calendar.
...
Post by dev
Regards,
Tim Dale, BRE
(remove all underscores to email directly)
I tried using the approach of the IExchange functions but couldn't get
my project to link without
the presence of MFC40.LIB, which I can't find anywhere at the moment,
and don't really
want to start messing around with.
I was wondering if there was a way of doing this without using the
IExchange functions.
However, if IExchangeManageStor, etc. is the only way to go, does
anyone know how to link
in Exchsdk.lib without having to use old out-of-date library files ?
I downloaded the Exchange 2007 SDK but it has completely different
library files.

Regards, Tim Dale, BRE