Microsoft DirectX 9.0

Step 4. Create the Property Page

At this point the filter supports everything that it needs for a property page. The next step is implementing the property page itself. Start by deriving a new class from CBasePropertyPage. The following example shows part of the declaration, including some private member variables that will be used later in the example:

class CGrayProp : public CBasePropertyPage
{
private:
    ISaturation *m_pGray;    // Pointer to the filter's custom interface.
    long        m_lVal       // Store the old value, so we can revert.
    long        m_lNewVal;   // New value.
public:
    /* ... */
};

Next, create a dialog resource in the resource editor, along with a string resource for the dialog title. The string will appear in the tab for the property page. The two resource IDs are arguments to the CBasePropertyPage constructor:

CGrayProp::CGrayProp(IUnknown *pUnk) : 
  CBasePropertyPage(NAME("GrayProp"), pUnk, IDD_PROPPAGE, IDS_PROPPAGE_TITLE),
  m_pGray(0)
{ }

The following illustration shows the dialog resource for the example property page.

Property Page Dialog

Now you are ready to implement the property page. Here are the methods in CBasePropertyPage to override:

The remainder of this tutorial describes each of these methods.