Click here to Skip to main content
15,884,298 members
Articles / Desktop Programming / ATL
Article

ATL Object Wizard Property Page

Rate me:
Please Sign up or sign in to vote.
1.80/5 (2 votes)
3 May 2000CPOL 69.1K   1.2K   29   3
A wizard that allows you to create an ATL Object Wizard Property Page
  • Download the source code - 38 Kb
  • Download the templates and precompiled DLL - 35 Kb
  • 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:

    1. Start the ATL Object Wizard using the 'New ATL Object' option avalable from the menus.

    2. Select the ATL Object Wizard component from the Wizards category.

      Image 1

      [NOTE: As a final test of the wizard I recreated the wizard using the original wizard as a starting point]

    3. 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.

      Image 2

    4. 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]

    5. 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

    License

    This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


    Written By
    Employed (other) Purplebricks
    Australia Australia
    All articles are supplied as-is, as a howto on a particular task that worked for me in the past. None of the articles are supposed to be out-of-the-box freeware controls and nor should they be treated as such. Caveat emptor.

    Now living and working in Australia, trying to be involved in the local .NET and Agile communities when I can.

    I spend a good chunk of my spare time building OpenCover and maintaining PartCover both of which are Code Coverage utilities for .NET.

    Comments and Discussions

     
    GeneralSuggestion: Add to your Control file (UPDATED) Pin
    Erik Thompson12-Apr-00 14:03
    sitebuilderErik Thompson12-Apr-00 14:03 
    GeneralRe: Suggestion: Add to your Control file (UPDATED) Pin
    Shaun Wilde15-Apr-00 0:32
    Shaun Wilde15-Apr-00 0:32 
    GeneralSuggestion: Add to your Control file... Pin
    Erik Thompson12-Apr-00 14:02
    sitebuilderErik Thompson12-Apr-00 14:02 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.