Specifying Property Pages

ATL COM Property Pages

When you create an ActiveX control, you will often want to associate it with property pages that can be used to set the properties of your control. Control containers use the ISpecifyPropertyPages interface to find out which property pages can be used to set your control's properties. You will need to implement this interface on your control.

To implement ISpecifyPropertyPages using ATL, take the following steps:

Note   When generating a full control (Full Control, DHTML Control, or Composite Control) using the ATL Object Wizard, you will only have to add the PROP_PAGE entries to the property map. The wizard generates the necessary code for the other steps.

Well-behaved containers will display the specified property pages in the same order as the PROP_PAGE entries in the property map. Generally, you should put standard property page entries after the entries for your custom pages in the property map, so that users see the pages specific to your control first.

Example

The following class for a calendar control uses the ISpecifyPropertyPages interface to tell containers that its properties can be set using a custom date page and the stock color page.

class ATL_NO_VTABLE CCalendar : 
    // ...
    public ISpecifyPropertyPagesImpl<CCalendar>,
    // ...
{
BEGIN_COM_MAP(CCalendar)
    // ...
    COM_INTERFACE_ENTRY(ISpecifyPropertyPages)
    // ...
END_COM_MAP()
// ...
BEGIN_PROP_MAP(CCalendar)
    // ...
    PROP_PAGE(CLSID_DatePage)
    PROP_PAGE(CLSID_StockColorPage)
    // ...
END_PROP_MAP()

};