Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The OpenEntry method opens a message store object and returns an interface pointer for further access.
HRESULT OpenEntry (
ULONG cbEntryID,
LPENTRYID lpEntryID,
LPCIID lpInterface,
ULONG ulFlags,
ULONG FAR * lpulObjType,
LPUNKNOWN FAR * lppUnk
);
This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:
OpenEntry opens a message store object, folder object, or message object, and returns a pointer that can be used to access the object, described in the following table:
Opened object | **lppUnk object interface | *lpulObjType |
---|---|---|
message store | IMsgStore | Not defined |
folder | IMAPIFolder | MAPI_FOLDER |
message | IMessage | MAPI_MESSAGE |
All MAPI OpenEntry methods call down to the same underlying helper function, so there's no performance hit in choosing IMsgStore::OpenEntry over IMAPISession::OpenEntry or IMAPIFolder::OpenEntry (which is accessible through IMAPIContainer::OpenEntry).
Calling OpenEntry and setting lpEntryID to point to the entry identifier of a message store is equivalent to calling the IMAPISession::OpenMsgStore method.
Check the value returned in the lpulObjType parameter to determine whether the object type returned is what you expected. If the object type is not the expected type, cast the pointer from the lppUnk parameter to a pointer of the appropriate type. For example, if you are opening a folder, cast lppUnk to a pointer of type LPMAPIFOLDER.
Pocket PC: Windows Mobile 2002 and later
OS Versions: Windows CE 3.0 and later
Header: mapidefs.h
Library: cemapi.lib
Send feedback on this topic to the authors.
© 2005 Microsoft Corporation. All rights reserved.
Please sign in to use this experience.
Sign in