A property page consists of a dialog resource, and class derived from IPropertyPagesImpl that is designed to manage this resource.
The IPropertyPagesImpl method supports a default implementation of the Activate and Apply methods. The Activate method is called by the Win32®-based Pipeline Editor when the property pages for a component are displayed. The Apply method is called when the user clicks the Apply button on the property pages dialog box.
Using the Visual C++ user interface to add a property page to the MinMaxShip project results in a default implementation of IPropertyPagesImpl.
Notice that the Interface edit box appears dimmed. This is because a property page does not need a custom interface.
The following three files are created.
File | Description |
---|---|
MinMaxPropPg.h | Contains the C++ class CMinMaxPropPg, which defines the property page. |
MinMaxPropPg.cpp | Includes the MinMaxPropPg.h file, and implements the Apply and Activate functions. |
MinMaxPropPg.rgs | The registry script that registers the property page object. |
The new property page is added to the object entry map in MinMaxShip.cpp. A reference to the MinMaxPropPg class is added to the MinMaxShip.idl file. The new registery script file, MinMaxPropPg.rgs is added to the project resource. A dialog box template is added to the project resource for the property page. The property strings you specified are added to the resource string table.
Your final step in creating the property page is to open the project’s resource file, display the dialog template for the property page (IDD_MINMAXPROPPG), and add the controls through which the user of the MinMaxShip component will modify the component’s properties.
When you are finished, the dialog template should look like this one.
The edit controls should be given the following resource identifiers, in this order:
IDC_PERCENTAGE, IDC_MINSHIPPING