ActiveX Control Containers: Inserting a Control into a Control Container Application

OverviewHow Do ISample

Before you can access an ActiveX control from an ActiveX control container application, you must use Gallery to add the ActiveX control to the container application.

To add an ActiveX control to the ActiveX control container project

  1. On the Project menu, select Add to Project and then Components and Controls.

    The Components and Controls Gallery appears. By default, you are looking into the Gallery folder.

  2. Open the Registered ActiveX controls folder.

  3. Select the control you want by clicking the ActiveX control icon in the list.

  4. Click Insert.

  5. Click OK to confirm that you want to insert the control.

    The Confirm Classes dialog box appears. This dialog box lists the class (or classes) that will be generated for each inserted control. It also lists the class name, header, and implementation files, which can be modified. (In the case of Container and Circ2, only one class is generated.)

  6. Click OK to accept the class generated by Gallery.

  7. Click Close to close the Components and Controls Gallery.

    An icon representing each control installed appears on the dialog editor Controls toolbar.

Once you complete this procedure, the class generated by Gallery, referred to as a wrapper class, is added to your project. This class is used as an interface between the control container and the embedded control.