ActiveX Designers handle events of several types. The most common involves a user clicking the mouse on an object presented at design time, typically to change its properties or attach code. At run time, the designer must also be prepared to handle events.
ActiveX Designers use the standard ActiveX event handling mechanism, supporting the IConnectionPoint and IConnectionPointContainer interfaces, along with interfaces for each type of event to be handled. The figure shows the basic approach to event handling.
IConnectionPoint allows the designer to expose an outgoing pointer to an object, typically an event sink. IConnectionPointContainer enumerates the connection points supported by an object, so that a caller can find the right connection point. When an event occurs, the ActiveX Designer uses a connection between the event source, which calls the interface that handles events of that type, and the event sink, which implements the interface. The sink implements the member functions for a set of events.
At design time, the host enumerates the set of events an object can trigger by inspecting the type information for the object's event set. To allow users of ActiveX Designers to write event handlers, the host can check the parameters of the events, and from them create a stub event handler for the user to fill in.
For property changes, ActiveX Designers implement a standard sink interface called IPropertyNotifySink.