IMessage (Compact 7)
3/12/2014
Learn about the IMessage interface in Windows Embedded Compact 7, which manages messages, attachments, and recipients.
Methods in Vtable Order
IMessage methods | Description |
---|---|
Returns the message's attachment IMAPITable object. |
|
Opens an IAttach object. |
|
Creates a new IAttach object. |
|
Deletes an IAttach object. |
|
Returns the message's recipient IMAPITable object. |
|
Adds, deletes, and modifies a message's list of recipients. This is contained in an ADRLIST structure. |
|
Saves all changes to the message, and marks it as ready for sending. |
|
IMessage::SetReadFlag |
Not supported, do not use. |
Properties
The properties listed in the following table are required on messages at some point during their life cycle. Read-only properties are set by the Transport Provider.
Required properties for messages of all classes | Access |
---|---|
Read-onfy |
|
Read-only |
|
Read/write |
|
Read/write |
|
Read-only |
|
Read-only |
|
Read-only |
|
Read-only |
|
Read-only |
The properties listed in the following tables are read-only to clients, except for PR_BODY. Clients construct this property when they process a report.
Properties for report messages | Access |
---|---|
Read/write |
|
Read-only |
|
Read-only |
|
Read-only |
|
Read-only |
|
Read-only |
Properties for message recipients | Access | Required or optional |
---|---|---|
Read-only |
Required |
|
Read-only |
Optional |
|
Read-only |
Required |
Remarks
IMessage is implemented by Message Store Providers, is called by Message Client applications, and is exposed by IMessage objects.
The IMessage interface identifier is IID_Message, and its pointer type is LPMESSAGE.
Code Example
The following code example shows how to use IMAPIProp::GetProps, which IMessage inherits from IMAPIProp.
Note
To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it is modified to include them.
HRESULT GetPropsExample(IMessage * pMsg)
{
HRESULT hr = E_FAIL;
SPropValue * rgprops = NULL;
ULONG rgTags[] = {3, PR_SENDER_EMAIL_ADDRESS, PR_SUBJECT, PR_IMPORTANCE};
ULONG cCount = 0;
// Get the message's properties.
hr = pMsg->GetProps((LPSPropTagArray) rgTags, MAPI_UNICODE, &cCount, &rgprops);
// Access the properties.
if (SUCCEEDED(hr))
{
// Check that the ulPropTag member of each property value is of the property type requested, and that it does not have a value of PT_ERROR.
if (rgprops[0].ulPropTag == PR_SENDER_EMAIL_ADDRESS)
DEBUGMSG(TRUE, (L"From: %s \r\n", rgprops[0].Value.lpszW));
if (rgprops[1].ulPropTag == PR_SUBJECT)
DEBUGMSG(TRUE, (L"Subject: %s \r\n", rgprops[1].Value.lpszW));
if (rgprops[2].ulPropTag == PR_IMPORTANCE)
DEBUGMSG(TRUE, (L"Importance: %d \r\n", rgprops[2].Value.ul));
// Free the returned SPropValue structure.
MAPIFreeBuffer(rgprops);
}
return hr;
}
Requirements
Header |
mapidefs.h |
Library |
cemapi.lib |