Catching Unified Communications Client API Events Using ATL Templates

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

In COM, event handling involves an implementation of the IDispatch interface to invoke a registered event handler when a certain event is raised in the source object. A special case of the IDispatch interface is dispinterface, which is used to define the events in Unified Communications Client API. Event handling, thus, involves implementing the event handlers, registering the implemented event handlers with the objects raising the events, and invoking the registered event handlers when the corresponding events occur. Objects raising events are also known as event sources. In Unified Communications Client API, event sources are represented by IUnknown interface instances.

The MFC library exposes ATL template classes that implement these basic and common functionalities of event handling, including registration and invocation of an event handler. An example is the IDispEventSimpleImplclass. Here, event registration amounts to advising an event source of an event handler implementation. An MFC application can take advantage of these template classes and focuses on the application-specific aspect of the event handling, namely, implementing the event handling logic.

This section describes how an MFC application can use the ATL templates to register event handlers and have them properly invoked when the corresponding events occur. The ATL template class of IDispEventSimpleImpl is used as an example to aid the discussions.

In This Section

See Also

Concepts

Using Unified Communications Client API in Win32/C++ Client
Getting Started Using Unified Communications Client API in an MFC Application
Obtaining Unified Communications Client API Interface Pointers
Reading and Setting Unified Communications Client API Interface Properties