To contain a COM control, a container must do two things:
The window that the container provides can be a parent window of the control or, in the case of a windowless control, can be shared by the control. The control uses the window in its interaction with the user. The interfaces that the container implements are used for integration with the control and mirror those that the control implements. Figure 12.1 shows the major interfaces that the container implements and how they are mirrored by those that the control implements.
Figure 12.1. Container and control interfaces
As mentioned in Chapter 11, "ActiveX Controls," full coverage of the interaction between controls and containers is beyond the scope of this book. Refer to the sources listed in Chapter 11 for more information. However, this chapter presents those things you need to know to host controls both in standalone applications and inside COM servers. Your hosting options include windows, dialogs, and composite controls. Before diving into the details of dialogs or controls hosting other controls, let's start with the basics by examining control containment in a simple frame window.