Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.95 KB

specifying-property-pages.md

File metadata and controls

34 lines (22 loc) · 1.95 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: Specifying Property Pages
Specifying Property Pages (ATL)
11/04/2016
ISpecifyPropertyPages method
property pages, specifying
ee8678cf-c708-49ab-b0ad-fc2db31f1ac3

Specifying 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:

  1. Derive your class from ISpecifyPropertyPagesImpl.

  2. Add an entry for ISpecifyPropertyPages to your class's COM map.

  3. Add a PROP_PAGE entry to the property map for each page associated with your control.

Note

When generating a standard control using the ATL Control 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.

[!code-cppNVC_ATL_Windowing#72]

See also

Property Pages
ATLPages Sample