|Microsoft Deployment Toolkit
Step 3: The UDI Wizard Displays the Custom Wizard Page
The custom wizard page in the example is defined in the LocationPage.cpp file. Wizard pages are derived from template classes that provide much of the functionality a page has. All wizard pages should derive from the WizardPageImpl template class, which implements the IWizardPage interface. Each wizard page can implement other optional template classes and corresponding interfaces based on the needs of the page.
For a list of the available:
· Template classes for wizard pages, see Wizard Page Helper Classes
· Interfaces for the wizard page template classes, see Wizard Page Interfaces
The custom wizard page in the example is derived from the WizardPageImpl template class and implements the IWizardPage interface. In addition, the custom wizard page implements the IFieldCallback interface. Both of these are implemented in the LocationPage.cpp file.
The example custom wizard page overrides the following methods:
· OnWindowCreated. The OnWindowCreated method in the example wizard page calls the following methods:
· InitFields. Use this method to initialize the fields (controls) that you have added to the form. The pointer of the page is a parameter. In the example, the this pointer is passed, which refers to the current page.
Note To support the use of the this pointer, you must implement the IFieldCallback interface in addition to the interfaces that the WizardPageImpl template class supports.
The IFieldCallback interface calls the SetFieldDefault method, which is used to set the default values for controls other than text box and check box controls. In the example, the SetFieldDefault method sets the initial index of the combo box control based on the default value specified in the Default element for the Field element in the Config.xml file.
· InitLocations. This method populates the combo box from the list of locations in the Config.xml file. The Data element and child DataItem elements the Confg.xml file provide the list of possible values.
· OnNextClicked. This method performs the following tasks:
· Adds information that will be shown on the Summary page using the SaveFields method