Microsoft DirectX 9.0


The OnActivate method is called when the property page is activated.


virtual HRESULT OnActivate(void);

Return Value

The base-class implementation returns S_OK.


The CBasePropertyPage::Activate method calls the OnActivate method. In your derived class, override OnActivate to initialize the dialog box.

Example Code

The following example initializes a trackbar control. This example assumes that m_pOwningFilter is a pointer to a custom interface on the filter associated with the property page. (Use the CBasePropertyPage::OnConnect method to initialize such pointers.)

HRESULT CMyProp::OnActivate(void)
    ASSERT(m_pOwningFilter != NULL);
    SendDlgItemMessage(m_Dlg, IDC_SLIDER1, TBM_SETRANGE, 0, MAKELONG(0, 100));
    SendDlgItemMessage(m_Dlg, IDC_SLIDER1, TBM_SETTICFREQ, 10, 0);
    SendDlgItemMessage(m_Dlg, IDC_SLIDER1, TBM_SETPOS, 1, m_lOldVal);
    return S_OK;

See Also