This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Opens a message store and returns an IMsgStore pointer for further access.
[in] A handle to the parent window of the common address dialog box and other related displays.
[in] The byte count in the entry identifier pointed to by the lpEntryID parameter.
[in] A pointer to the entry identifier of the message store to be opened. The lpEntryID parameter must not be NULL.
[in] A pointer to the interface identifier (IID) that represents the interface to be used to access the message store. Passing NULL causes the lppMDB parameter to return a pointer to the standard interface for a message store (IMsgStore).
[in] A bitmask of flags that controls how the object is opened. The following flags can be used:
Requests that the message store be opened with the maximum network permissions allowed for the user and the maximum client application permissions. For example, if the client has read/write permission, the message store should be opened with read/write permission; if the client has read-only permission, the message store should be opened with read-only permission.
Allows OpenMsgStore to return successfully, possibly before the message store is fully available to the calling client. If the message store is not available, making a subsequent object call can raise an error.
Prevents the display of logon dialog boxes. If this flag is set, and OpenMsgStore has insufficient configuration information to open the message store without the user's help, it returns MAPI_E_LOGON_FAILED. If this flag is not set, the message store provider can prompt the user to correct a name or password or to perform other actions necessary to establish a connection to the message store.
The message store should not be used for sending or receiving mail. When this flag is set, MAPI does not notify the MAPI spooler that this message store is being opened.
Instructs MAPI that the message store is not permanent and should not be added to the message store table. This flag is used to log on to the message store so information can be retrieved programmatically from the profile section.
Requests read/write permission to the message store.
[out] A pointer to a pointer to the message store.
An attempt was made to access a message store for which the user has insufficient permissions.
The message store indicated by lpEntryID does not exist.
The server is not configured to support the client's code page.
The server is not configured to support the client's locale information.
The call succeeded, but the message store provider has error information available. When this warning is returned, the call should be handled as successful. To get the error information from the provider, call the IMAPISession::GetLastError method. To test for this warning, use the HR_FAILED macro. For more information, see Using Macros for Error Handling.
The default permission level for message stores is read-only. If you set the MDB_WRITE flag, you may or may not be granted read/write permission. The final level of access that MAPI assigns to the message store depends on your permission level, the message store itself, and the message store provider.
If you call OpenMsgStore to open a message store with read-only permission, the following will occur:
The store's PR_STORE_SUPPORT_MASK (PidTagStoreSupportMask) property will not have its STORE_MODIFY_OK and STORE_CREATE_OK bits set.
Calls to open one of the message store's messages or folders by using IMAPISession::OpenEntry with the MAPI_MODIFY flag set will fail.
Calls to open one of the properties of the message store's messages or folders by using IMAPIProp::OpenProperty with the MAPI_MODIFY flag will fail.