Platform SDK: MAPI

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. The info member contains an ERROR_NOTIFICATION structure.
fnevExtended
An internal event defined by a particular service provider has occurred. The info member contains an EXTENDED_NOTIFICATION structure.
fnevNewMail
A message has been delivered to the appropriate receive folder for the message class and is waiting to be processed. The info member contains an NEWMAIL_NOTIFICATION structure.
fnevObjectCopied
A MAPI object has been copied. The info member contains an OBJECT_NOTIFICATION structure.
fnevObjectCreated
A MAPI object has been created. The info member contains an OBJECT_NOTIFICATION structure.
fnevObjectDeleted
A MAPI object has been deleted. The info member contains an OBJECT_NOTIFICATION structure.
fnevObjectModified
A MAPI object has changed. The info member contains an OBJECT_NOTIFICATION structure.
fnevObjectMoved
A message store or address book object has been moved. The info member contains an OBJECT_NOTIFICATION structure.
fnevSearchComplete
A search operation has finished and the results are available. The info member contains an OBJECT_NOTIFICATION structure.
fnevTableModified
Information in a table has changed. The info member contains an TABLE_NOTIFICATION structure.
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.

Remarks

One or more NOTIFICATION structures are passed as input parameters with every call to a registered advise sink's IMAPIAdviseSink::OnNotify method. The NOTIFICATION structures contain information about the particular events that have occurred and describe the affected objects.

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.
Supporting Event Notification Discussion of how service providers can use the IMAPISupport method to generate notifications.

See Also

Notification Structures, ERROR_NOTIFICATION, EXTENDED_NOTIFICATION, NEWMAIL_NOTIFICATION, OBJECT_NOTIFICATION, STATUS_OBJECT_NOTIFICATION, TABLE_NOTIFICATION