Compartilhar via


MAPI Forms 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.

Registering for and handling notifications from form objects is a different process than for other MAPI objects. Advise sinks for form notifications implement either the IMAPIViewAdviseSink or IMAPIFormAdviseSink interface rather than IMAPIAdviseSink. IMAPIViewAdviseSink : IUnknown and IMAPIFormAdviseSink : IUnknown each have multiple methods, one for each of the possible events that the corresponding advise source is capable of generating. For example, IMAPIFormAdviseSink has two methods: IMAPIFormAdviseSink::OnChange to handle a change to the form viewer's status and IMAPIFormAdviseSink::OnActivateNext to display a new message with the correct form.

The event handling strategy for forms is similar to the event handling strategy implemented in OLE. Clients do not register for specific event types as they do for most MAPI objects. The assumption is that registering for notification enables them to receive any type of event that can be generated by the particular advise source. Because IMAPIAdviseSink::OnNotify must be written so as to handle all registered events, implementing it can be complex for clients that register for many different events. Because the methods in the form advise sink objects target a single event, implementing these methods is simpler.