IMAPISession::OpenMsgStore

来源:互联网 发布:rpc java php 编辑:程序博客网 时间:2024/05/19 00:07

The OpenMsgStore method opens a message store and returns a reference to the IMsgStore object for further access.

OpenMsgStore 函数打开一个短消息store,并返回一个涉及到的IMsgStore对象

Syntax

 
HRESULT OpenMsgStore (  ULONG ulUIParam,  ULONG cbEntryID,  LPENTRYID lpEntryID,  LPCIID lpInterface,  ULONG ulFlags,  LPMDB FAR * lppMDB);

Parameters

ulUIParam

[in] Ignored.

cbEntryID

[in] Count of bytes in the entry identifier specified by lpEntryID.

lpEntryID

[in] Reference to the entry identifier of the message store that is to be opened.

lpInterface

[in] Ignored.

ulFlags

[in] Ignored.

lppMDB

[out] Reference to the message store object, implemented on IMsgStore.

Return Value

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

S_OK

Indicates success.

MAPI_E_NO_ACCESS

An attempt was made to access a message store for which the user has insufficient permissions.

MAPI_E_NOT_FOUND

The message store indicated by lpEntryID does not exist.

MAPI_E_UNKNOWN_CPID

The server is not configured to support the client code page.

MAPI_E_UNKNOWN_LCID

The server is not configured to support the client locale information.

MAPI_W_ERRORS_RETURNED

The call succeeded, but the message store provider has error information available. When this warning is returned, the call should be handled as successful.

Remarks

The access level for message stores is always read/write.

Requirements

Pocket PC: Pocket PC 2002 and later

Smartphone: Smartphone 2002 and later

OS Versions: Windows CE 3.0 and later

Header: mapix.h

Library: cemapi.lib

sample code

IMAPISession *pSession = NULL;


 SRowSet *psrs = NULL;

LPMAPITABLE pTable  = NULL;

pTable->QueryRows(1, 0, &psrs)

 pSession->OpenMsgStore(NULL,
    psrs->aRow[0].lpProps[0].Value.bin.cb,
    (ENTRYID *)psrs->aRow[0].lpProps[0].Value.bin.lpb,
    NULL,
    0,
    &pStore);