Article ID: 159287 - Last Review: October 28, 2006 - Revision: 3.4 XCLN: MAPIFindNext Fails to Retrieve Message IdentifiersThis article was previously published under Q159287 On This PageSYMPTOMS
Using the simple MAPI function MAPIFindNext in MAPI version 1.0 may fail to
retrieve the next (or first) message identifier of a specified type of
incoming message. The following is the resulting return code of the
MAPIFindNext call:
CAUSE
When you use MAPI version 1.0, choosing the value "IPM." for parameter
lpszMessageType in the MAPIFindNext function call does not retrieve the
next message identifier of the specified type (IPM) of incoming message.
This value has been used successfully in previous versions of simple MAPI
to enumerate all messages of a given message type.
WORKAROUND
Instead of using "IPM." as value to enumerate messages of an IPM message
type, specify "NULL" (without the quotation marks) in the lpszMessageType
parameter of the MAPIFindNext function call.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft Exchange
clients, version 4.0, listed at the beginning of this article. This problem
was corrected in Microsoft Exchange Server 4.0 U.S. Service Pack 4. For
information on obtaining the service pack, query on the following word in
the Microsoft Knowledge Base (without the spaces):
S E R V P A C K
MORE INFORMATION
The MAPI SDK online documentation states the following regarding the
lpszMessageType parameter of the MAPIFindNext function:
When the lpszSeedMessageID parameter is NULL or points to an empty
string, MAPIFindNext returns the message identifier for the first
message of the type specified by the lpszMessageType parameter. When
lpszSeedMessageID contains a valid identifier, the function returns the
next matching message of the type specified by lpszMessageType. Repeated
calls to MAPIFindNext ultimately result in a return of the
MAPI_E_NO_MESSAGES value, which means the enumeration is complete.
Message type matching is done against message class strings. All message
types whose names match (up to the length specified in lpszMessageType)
are returned.
The last sentence implies that a message type string portion such as "IPM."
or "IPC." can be used with wildcard functionality to enumerate all messages
of the given message type. As a result, there are two methods for
successfully enumerating IPM type messages using simple MAPI:
InstallationThis description uses the Microsoft Exchange Windows NT client, version 4.0 as an example.
| Article Translations
|

Back to the top
