CBasePropertyPage.OnActivate method

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

Syntax


virtual HRESULT OnActivate();

Parameters

This method has no parameters.

Return value

The base-class implementation returns S_OK.

Remarks

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

Examples

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);
    m_pOwningFilter->GetSomeProperty(&m_lOldVal);
    
    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;
}


Requirements

Header

Cprop.h (include Streams.h)

Library

Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CBasePropertyPage Class

 

 

Show: