ATL Object Wizard Property Page






1.80/5 (2 votes)
A wizard that allows you to create an ATL Object Wizard Property Page
This custom wizard allows you to create an ATL Object Wizard Property Page that can get called during your custom object creation.
Installation
To install the ATL Object Wizard Property Page component you need to download ATL_pp_wizard_dll.zip and extract the files to '???\Program Files\Microsoft Visual Studio\Common\MSDev98\Template\ATL'. You then need to register atlsymwz.dll using regsvr32.exe. The ATL Object Wizard Property Page component should then be available from ATL Object Wizard.
Usage
To create you very own ATL Object Wizard property page follow these simple steps:
- Start the ATL Object Wizard using the 'New ATL Object' option avalable from the menus.
- Select the ATL Object Wizard component from the Wizards
category.
[NOTE: As a final test of the wizard I recreated the wizard using the original wizard as a starting point]
- Fill in the Names and Strings pages as you would a normal
Property Page object.
This wizard is similar to the Property Page wizard found under the Controls category however the Attributes page has been removed and the following page has been added.
- Fill in the 'Object Wizard Settings' page.
The Category field indicates what category you wish your component to come under and the Title field is for the name you wish to give your object. Two other field are supplied and these are the Control File and the Icon File, these fields indicate what .ctl file you wish to call when your object is selected and the icon file is for what Icon to display in the ATL Object Wizard. There are options to create stubs for these files if they do not already exist. [NOTE: several of the wizards use control.ctl as the control file but supply different icons]
- Add your own controls to the page and create your own symbols using the ISymbolMap interface. However before you start creating your own custom control templates I suggest you also read the references and investigate the currently available wizards that are available in '???\Program Files\Microsoft Visual Studio\Common\MSDev98\Template\ATL'.
Auto Generated Code
I have supplied two methods EnableOK() and DisableOK() which are used to enable and disable the OK button at the bottom of the property sheet. If you need to disable the OK button and only enable it when the user has filled in some fields, like I did with this wizard, then I suggest you put in a call to DisableOK() in the Apply method when m_hWnd is NULL (see the source code to atlsymwiz.dll.)
References
- Template.txt found in '???\Program Files\Microsoft Visual Studio\Common\MSDev98\Template\ATL' - This is actually a HTML file and is easier if renamed or copied to template.htm
- Q179385 - HOWTO: Add Custom ATL Objects to the ATL Object Wizard
- Customizing the ATL Object Wizard A Real-World Example - Glenn Carr - should be available at Visual C++ Developers Journal
- Q223439 - HOWTO: Using Class Wrappers to Access Windows Common Controls in ATL
Unicode
Even though I have tested the code in unicode format I decided it was needless as I wanted the wizards to run under VC6 regardless of whether they were running under NT or Win9x.
STL
Because I have used the STL to give me extra functionality such as maps and lists etc. this code does produce known warnings when compiled under 'Warning Level 4'.
History
1 May 2000: Updated source so that registration code is inserted by the wizard as suggested by Erik Thompson