Handling Notifications
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Notifications enable one object to inform another object that it has undergone a change. The type of change is referred to as an event. MAPI defines several events for which notifications are generated.
Clients typically register for one or more events with one or more objects. These objects are referred to as advise sources. Objects that can act as advise sources include the session object, under MAPI's control, or an object created by a service provider, such as a message. The informed object, referred to as the advise sink, contains either an implementation of the IMAPIAdviseSink : IUnknown interface or the IMAPIViewAdviseSink : IUnknown interface and is within a client application.
Advise source objects implement an Advise method, which is called by clients to register for notifications, and an Unadvise method, which is called to cancel a registration. One of the parameters to Advise is a pointer to an implementation of IMAPIAdviseSink or IMAPIViewAdviseSink. The advise source caches this pointer so that it can call IMAPIAdviseSink::OnNotify or one of the methods in IMAPIViewAdviseSink when a change occurs.
Because receiving notifications enables users to view the most up-to-date information, it is recommended that all clients register for and handle notifications. However, it is optional.
In This Section
Registering for a Notification
Describes how to register a client for notifications as a part of its initialization process.Canceling a Notification
Describes how to cancel a subscription to a notification.Handling Message Store Notification
Describes how to register for message store notifications.Handing Address Book Notification
Describes how to register for and handle address book notifications.Handling Table Notification
Describes how to register for notifications from the hierarchy table.Implementing an Advise Sink Object
Describes how to implement an advise sink object.Timing a Notification
Describes the timing of client notification by service providers.Ensuring a Thread-Safe Notification
Describes how to ensure thread-safe notification with MAPI.Forcing a Notification
Describes how to force a notification in MAPI.