More Wizard Options for Controls [Previous] [Next]

More Wizard Options for Controls

In addition to the normal options (which you can apply to all COM objects), the ATL Object Wizard gives you several options specific to control creation. First, the ATL Object Wizard lets you subclass your control from a regular control (such as a button control or an edit control). You can specify other options for your control—make the control opaque, give it a solid background, render it invisible at run time, make it act like a button, and so on. In this section, we give you a rundown of the options available in the control's property pages. Figure 10-1 shows the control options available through the ATL Object Wizard's Miscellaneous property page.

Figure 10-1. The ATL Object Wizard's Miscellaneous property page.

Here's a description of each option:

You can also decide on your object's stock properties up front. In the Stock Properties page, select the stock properties you want the object to support, such as Caption or Border Color. You can select all the stock properties at once by clicking the >> button. This adds properties to the control's property map.

After you run the ATL COM AppWizard and the Object Wizard, you get a DLL replete with all the hooks necessary to be a COM DLL. The well-known exports that the control exposes include DllGetClassObject, DllCanUnloadNow, DllRegisterServer, and DllUnregisterServer. In addition, you get an object that satisfies the main requirements of COM, including a main incoming interface and a class object.

Once you've started a project using one of the wizards, your next step is to get the control to do something interesting. Let's look at an ActiveX control that actually does some real work.