cmc_read
The cmc_read
function reads a specified message.
Quick Info
Header
file: |
XCMC.H |
CMC_return_code cmc_read (
CMC_session_id session,
|
|
CMC_message_reference * message_reference, |
|
CMC_flags read_flags,
|
|
CMC_message FAR * FAR * message,
|
|
CMC_ui_id ui_id, |
|
CMC_extension FAR * read_extensions |
|
) |
|
Parameters
session
[in] Opaque
session handle that represents a MAPI session object indicating a session with
a message service. If the value provided for the session parameter is
invalid, the cmc_read function returns cmc_e_invalid_session_id.
message_reference
[in] Pointer
to a CMC_message_referencecmc_e_invalid_message_reference.
read_flags
[in] Bitmask
of flags. The following flags can be set:
CMC_DO_NOT_MARK_AS_READ
Does not mark
messages as read when they are returned. This flag also suppresses sending of
receipt reports. The calling client application or service provider can query
the implementation to see if it supports this flag by calling the cmc_query_configuration
CMC_ERROR_UI_ALLOWED
Displays a
dialog box on encountering recoverable errors. If this flag is not set, cmc_read
does not display a dialog box and returns an error value instead.
CMC_MSG_AND_ATT_HDRS_ONLY
The attach_filename
fields in the CMC_message
Note that if the CMC_MSG_TEXT_NOTE_AS_FILE value is set in the flags of
the returned message, the first attachment contains the message text. In this
case, cmc_read returns the attach_filename field for that
attachment regardless of the setting of the CMC_MSG_AND_ATT_HDRS_ONLY flag.
CMC_READ_FIRST_UNREAD_MESSAGE
Returns the
first message that is not marked as read. If this flag is not set, cmc_read
should return the first message in the mailbox, whether it is marked as read or
not. This flag can only be set when passing a null message reference to receive
the first message in the mailbox.
message
[out] Pointer
to the location to which cmc_read writes the CMC_message
ui_id
[in] Handle
of a dialog box for cmc_read to present to help resolve processing
questions.
read_extensions
[in, out]
Pointer to an array of CMC_extension
On output, cmc_read writes to the array new information about
the read operation. It writes NULL if it generates no output extensions.
Return Values
CMC_E_ATTACHMENT_OPEN_FAILURE
The specified
attachment was found but could not be opened, or the attachment file could not
be created.
CMC_E_ATTACHMENT_READ_FAILURE
The specified
attachment was found and opened, but there was an error reading it.
CMC_E_ATTACHMENT_WRITE_FAILURE
The attachment
file was created successfully, but there was an error writing it.
CMC_E_DISK_FULL
Insufficient
disk space was available to complete the requested operation (this can refer to
local or shared disk space).
CMC_E_FAILURE
There was a
general failure that does not fit the description of any other return value.
CMC_E_INSUFFICIENT_MEMORY
Insufficient
memory was available to complete the requested operation.
CMC_E_INVALID_FLAG
A flag set
using a flags parameter was invalid.
CMC_E_INVALID_MESSAGE_REFERENCE
The specified
message reference is invalid or no longer valid (for example, it has been
deleted).
CMC_E_INVALID_PARAMETER
A function
parameter was invalid.
CMC_E_INVALID_SESSION_ID
The specified
session handle is invalid or no longer valid (for example, after logging off).
CMC_E_INVALID_UI_ID
The specified
user-interface identifier is invalid or no longer valid.
CMC_E_TOO_MANY_FILES
The current
implementation cannot support the number of files specified.
CMC_E_UNABLE_TO_NOT_MARK_READ
The current
implementation cannot support the CMC_DO_NOT_MARK_AS_READ flag.
CMC_E_UNSUPPORTED_FLAG
The current
implementation does not support the flag requested.
CMC_E_UNSUPPORTED_FUNCTION_EXT
The current
implementation does not support the function extension requested.
Remarks
The cmc_read
function only reads the first message in the mailbox if the client application
passes a null message-reference value.
After
processing, cmc_read writes the data from the message into the CMC_message
The cmc_read
function can write multiple addresses. Before it writes message information, it
must allocate memory for the structure to contain that information. When this
memory is no longer needed, the client application should free all structures
in the array with a call to the cmc_free
See Also