CBasePropertyPage Class
A version of this page is also available for
4/8/2010
This class is an abstract class for implementing a property page. Use this class if you are writing a filter (or other object) that supports property pages.
A property page is a COM object, so you must generate a GUID for the class identifier (CLSID) and provide an entry in the CFactoryTemplate Class array.
Your filter must expose the ISpecifyPropertyPages:IUnknown interface. This interface contains a single method, ISpecifyPropertyPages::GetPages, which returns the CLSID of the property page. The following example shows how to implement this method:
STDMETHODIMP CMyFilter::GetPages(CAUUID *pPages)
{
if (!pPages) return E_POINTER;
pPages->cElems = 1;
pPages->pElems =reinterpret_cast<GUID*>(
CoTaskMemAlloc(sizeof(GUID)));
if (pPages->pElems == NULL)
{
return E_OUTOFMEMORY;
}
*(pPages->pElems) = CLSID_MyPropPage;
return S_OK;
}
Remember to override the filter's NonDelegatingQueryInterface method as well. For more information, see INonDelegatingUnknown Interface**.
Next, create the dialog as a resource in your project, and create a string resource that holds the dialog title. Both of these resource IDs are parameters to the CBasePropertyPage constructor. Keeping the title string in a resource makes it easier to localize your property page.
The CBasePropertyPage class provides a framework for the IPropertyPage interface. This framework calls a number of virtual methods, including CBasePropertyPage::OnActivate, CBasePropertyPage::OnApplyChanges, and so on. In the base class, these methods simply return S_OK. Your derived class will need to override some or all of these virtual methods. For details, see the remarks for the individual methods.
Protected Member Variables
Member | Description |
---|---|
Indicates whether any of the properties have changed. |
|
Resource identifier for the dialog. |
|
Handle to the dialog window. |
|
Handle to the dialog window. |
|
Pointer to the IPropertyPageSite interface of the property page site. |
|
Resource identifier for a string that contains the dialog title. |
Public Methods
Method | Description |
---|---|
Constructor method. |
|
Destructor method. Virtual. |
|
Called when the property page is activated. Virtual. |
|
Called when the user applies changes to the property page. Virtual. |
|
Provides an IUnknown pointer to the object associated with the property page. Virtual. |
|
Called when the dialog box window is destroyed. Virtual. |
|
Called when the property page should release the associated object. Virtual. |
|
Called when the dialog box receives a message. Virtual. |
IPropertyPage Methods
Method | Description |
---|---|
Creates the dialog box window. |
|
Applies the current property page values to the object associated with the property page |
|
Destroys the dialog window. |
|
Retrieves information about the property page. |
|
Invokes the property page help. |
|
Indicates whether the property page has changed since it was activated or since the most recent call to IPropertyPage::Apply. |
|
Positions and resizes the dialog box. |
|
Provides IUnknown pointers for the objects associated with the property page. |
|
Initializes the property page. |
|
Shows or hides the dialog box. |
|
Instructs the property page to process a keystroke. |
Requirements
Windows Embedded CE | Windows CE 2.12 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
Note | Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements For more information, see Setting Up the Build Environment |