Inserting a Composite Control
Another helpful wizard (ATL Object Wizard) provided by Visual C++ allows you to quickly insert an ATL object into your existing project. Access this wizard by choosing the New ATL Object option from the Insert menu or the ATL Object Wizard button from the ATL toolbar.
Once the ATL Object Wizard appears, choose the Controls option (in the left-hand pane) and then double-click the Composite Control item. At this point, you need to supply some information on the properties of the composite control you are inserting. For complete details on using the ATL Object Wizard, see Adding Objects and Controls.
-
The first page (Names) requests information related to the implementation class: short name, .H and .CPP files, and so on. Enter a value for the short name. All other entries are generated automatically, using the short name as the basis.
-
The second page (Attributes) presents default options related to the threading model interface and aggregation of the composite control. Accept the default options, or customize them, based on the needs of your composite control.
-
The final page (Stock Properties) provides a list of common control properties your composite control can support. Choose any necessary properties from the left-hand list.
Once you have made your selections, click OK. The ATL Object Wizard then creates the necessary parts which implement your composite control. These parts include:
-
A template for the dialog box that implements the composite control.
-
A custom resource, REGISTRY, that automatically registers the composite control when invoked.
-
A C++ class that implements the composite control.
-
A COM interface, exposed by the composite control.
-
An HTML test page containing the composite control.