The UDI Wizard uses class factories to create new instances of objects for you. These factories are registered with a factory registry, using a string as the key to the factory. For example, the WmiRepository component is identified by the string "Microsoft.Wizard.WmiRepository," which is available in the IWmiRepository header file as ID_WmiRepository.

Assuming that you have written your page as a subclass of WizardPageImpl, you can create a new instance of a WmiRepoistory like this:

PWmiRepository pWmi;

CreateInstance(Container(), ID_WmiRepository, &pWmi);

The CreateInstance function is a type-safe template function for creating new instances of components. PWmiRepository is a smart pointer, so it handles reference counting for you.

Related Topics

Wizard Page Components