Step 5. Store a Pointer to the Filter

 
Microsoft DirectShow 9.0

Step 5. Store a Pointer to the Filter

Override the CBasePropertyPage::OnConnect method to store a pointer to the filter. The following example queries the pUnk parameter for the filter's custom ISaturation interface:

HRESULT CGrayProp::OnConnect(IUnknown *pUnk)
{
    if (pUnk == NULL)
    {
        return E_POINTER;
    }
    ASSERT(m_pGray == NULL);
    return pUnk->QueryInterface(IID_ISaturation, 
        reinterpret_cast<void**>(&m_pGray));
}

Next: Step 6. Initialize the Dialog.

See Also