Chapter 12. Control Containment

Containment of COM controls can take many forms. A window can contain any number of COM controls, as can a dialog or another control (called a composite control). All these containers share common characteristics, which is the subject of this chapter.

How Controls Are Contained

To contain a COM control,[1] a container must do two things:

1. Provide a window to act as the parent for the child COM control. The parent window can be used by a single child COM control or can be shared by many.

2. Implement a set of COM interfaces that the control uses to communicate with the container. The container must provide at least one object per control, called the site, to implement these interfaces. However, the interfaces ...

Get ATL Internals: Working with ATL 8, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.