Microsoft Deployment Toolkit
Documentation Library Step 2: The UDI Wizard Loads the DLL for the Custom Wizard Page |
When the UDI Wizard loads your DLL, it calls the RegisterFactories function, which must be implemented in your .dll file. In the example, this function is implemented in the dllmain.ccp file. Each wizard page you create must implement the RegisterFactories function.
The RegisterFactories function is used to register the factory class of your wizard page with the class factory registry for the UDI Wizard. Class factories are classes that can create an instance of another class. The RegisterFactories function creates a new instance of a factory class and passes that class to the class factory registry for the UDI Wizard, which makes that factory class available to the wizard. The UDI Wizard looks for a factory class registered with an ID that matches the Type attribute of the Page element for the custom wizard page.
In the example, the ID is defined as ID_Location in the PageClassIds.h file as Microsoft.SamplePage.LocationPage, which matches the Type attribute for the Page element in the Config.xml file. ID_Location is passed as a parameter in the RegisterFactories function implemented in the dllmain.ccp file.
You can create a function using the Register_name function template to simplify the creation of a new factory instance and register the newly created instance. The name value provided using the Register function template must implement the iClassFactory interface. The ClassFactoryImpl class handles most of the details for implementing a class factory.
You can also use the RegisterFactories function to register task types and validator types. For more information, see the following:
· Creating Custom UDI Validators
Note The example contains and registers only the one custom wizard page. The example does not include custom tasks or validators and so does not register any custom tasks or validators.
Related Topics