Share via


Adding Functionality to the Composite Control

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Adding Functionality to the Composite Control.

Once you have inserted any necessary controls into the composite control, the next step involves adding new functionality. This new functionality usually falls into two categories:

  • Supporting additional interfaces and customizing the behavior of your composite control with additional, specific features.

  • Handling events from the contained ActiveX control (or controls).

For the purpose and scope of this article, the remainder of this section focuses solely on handling events from ActiveX controls.

Note

If you need to handle messages from Windows controls, see Implementing a Window for more information on message handling in ATL.

After inserting an ActiveX control in the dialog resource, right-click the control and click Add Event Handler. Select the event you want to handle and click Add and Edit. The event handler code will be added to the control's .h file.

Connection points for ActiveX controls on the composite control are automatically connected and disconnected via calls to CComCompositeControl::AdviseSinkMap.

See Also

Composite Control Fundamentals