This documentation is archived and is not being maintained.


Last modified: January 16, 2009

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Defines a callback function that MAPI calls to send an event notification. This callback function can only be used when wrapped in an advise sink object created by calling the HrAllocAdviseSink function.

Header file:


Defined function implemented by:

Client applications and service providers

Defined function called by:


  LPVOID lpvContext,
  ULONG cNotification,
  LPNOTIFICATION lpNotifications


[in] Pointer to an arbitrary value passed to the callback function when MAPI calls it. This value can represent an address of significance to the client application or service provider. Typically, for C++ code, the lpvContext parameter represents a pointer to a C++ object.


[in] Count of event notifications in the array indicated by the lpNotifications parameter.


[out] Pointer to the location where this function writes an array of NOTIFICATION structures that contains the event notifications.

The set of valid return values for the NOTIFCALLBACK function prototype depends on whether the function is implemented by a client application or a service provider. Clients should always return S_OK. Providers can return either S_OK or CALLBACK_DISCONTINUE.

CALLBACK_DISCONTINUE is a valid return value for synchronous callback functions only; it requests that MAPI immediately stop processing the callbacks for this notification. When CALLBACK_DISCONTINUE is returned, MAPI sets the lpUlFlags parameter to NOTIFY_CANCELED when it returns from IMAPISupport::Notify.

The following are limitations on what a synchronous callback function can do:

  • It cannot cause another synchronous notification to be generated.

  • It cannot display a user interface.