NOTIFICATION
The NOTIFICATION
structure contains information about an event that has occurred and the
data that has been affected by the event.
Quick Info
Header
file: |
MAPIDEFS.H |
typedef struct
{
ULONG ulEventType;
union
{
ERROR_NOTIFICATION err;
NEWMAIL_NOTIFICATION
newmail;
OBJECT_NOTIFICATION obj;
TABLE_NOTIFICATION tab;
EXTENDED_NOTIFICATION ext;
STATUS_OBJECT_NOTIFICATION statobj;
} info;
} NOTIFICATION, FAR *LPNOTIFICATION;
Members
ulEventType
Type of
notification event that occurred. The value of the ulEventType member
corresponds to the structure that is included in the info union.
The ulEventType
member can be set to one of the following values:
fnevCriticalError
A global
error has occurred, such as a session shut down in progress.
fnevExtended
An internal
event defined by a particular service provider has occurred.
fnevNewMail
A message has
been delivered to the appropriate receive folder for the message class and is
waiting to be processed.
fnevObjectCopied
A MAPI object
has been copied.
fnevObjectCreated
A MAPI object
has been created.
fnevObjectDeleted
A MAPI object
has been deleted.
fnevObjectModified
A MAPI object
has changed.
fnevObjectMoved
A message
store or address book object has been moved.
fnevSearchComplete
A search
operation has finished and the results are available.
fnevTableModified
Information
in a table has changed.
info
Union of
notification structures describing the affected data for a particular type of
event. The structure included in the info member depends on the value of
the ulEventType member.
The
following table relates event types with the corresponding type of notification
structure.
Value
for ulEventType member |
Structure
type in info member |
fnevCriticalError |
ERROR_NOTIFICATION |
fnevExtended |
EXTENDED_NOTIFICATION |
fnevNewMail |
NEWMAIL_NOTIFICATION |
fnevObjectCreated |
OBJECT_NOTIFICATION |
fnevObjectDeleted |
OBJECT_NOTIFICATION |
fnevObjectModified |
OBJECT_NOTIFICATION |
fnevObjectCopied |
OBJECT_NOTIFICATION |
fnevObjectMoved |
OBJECT_NOTIFICATION |
fnevSearchComplete |
OBJECT_NOTIFICATION |
fnevTableModified |
TABLE_NOTIFICATION |
Remarks
One
or more NOTIFICATION structures are passed as an input parameter with
every call to a registered advise sink s IMAPIAdviseSink::OnNotify
Before
clients or service providers receiving a notification can use the structure to
process the event, they must check the event type as indicated in the ulEventType
member. For example, the code sample below checks for the arrival of a new
message and upon detecting an event of this type, prints out the message class
of the message.
if (pNotif -> ulEventType == fnevNewMail)
{
printf("%s\n", pNotif -> newmail.lpszMessageClass)
}
For more
information about notification, see the topics described in the following
table.
Topic |
Description |
Event
Notification in MAPI |
General
overview of notification and notification events. |
Handling
Notifications |
Discussion
of how clients should handle notifications. |
Using a
Support Object for Event Notification |
Discussion
of how service providers can use the IMAPISupport method to generate
notifications. |
See Also