This is a useful base class for creating a class factory that you can then register with the factory registry.

The following is an excerpt from the LocationPage.h file in the sample project to define the ClassFactoryImpl class.

#pragma once

 

#include "ClassFactoryImpl.h"

 

class LocationPageFactory : publicClassFactoryImpl

{

protected:

    IUnknown *CreateNewInstance();

};

 

The following is an excerpt from the LocationPage.cpp file in the sample wizard page used to define the class factory for the page.

IUnknown *LocationPageFactory::CreateNewInstance()

{

    return static_cast<IWizardPage *>(new LocationPage);

}

Related Topics

Wizard Page Helper Classes