Compartir a través de


CBasePropertyPage::OnActivate

 
Microsoft DirectShow 9.0

CBasePropertyPage::OnActivate

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

Syntax

  virtual HRESULT OnActivate(void);

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.

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);
    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:** Declared in Cprop.h; include Streams.h.

**  Library:** Use Strmbase.lib (retail builds) or Strmbasd.lib (debug builds).

See Also