Filter属性页的显示

函数:

void ShowFilterProperty(HWND hWnd)
{
    //Obtain the filter's IBaseFilter interface.(Not shown)
    ISpecifyPropertyPages *pProp = NULL;
    HRESULT hr = m_pBF->QueryInterface(IID_ISpecifyPropertyPages,(void**)&pProp);
    if(SUCCEEDED(hr))
    {
        //Get the filter's name and IUnknown pointer.
        FILTER_INFO FilterInfo;
        hr = m_pBF->QueryFilterInfo(&FilterInfo);
        IUnknown *pFilterUnk;
        m_pBF->QueryInterface(IID_IUnknown,(void**)&pFilterUnk);
        //Show the page
        CAUUID caGUID;
        pProp->GetPages(&caGUID);
        pProp->Release();
        OleCreatePropertyFrame(hWnd,
            0,0,
            FilterInfo.achName,
            1,
            &pFilterUnk,
            caGUID.cElems,
            caGUID.pElems,
            0,
            0,NULL
            );
        //Clean up
        pFilterUnk->Release();
        FilterInfo.pGraph->Release();
        CoTaskMemFree(caGUID.pElems);
    }
}

 

调用:

void OnClickedBtnProperty()
{
    // TODO: 在此添加控件通知处理程序代码
    HWND hmain;
    hmain=this->m_hWnd;
    m_cap->ShowFilterProperty(hmain);
}

 

posted on 2014-05-04 16:13  撼地神牛ES  阅读(253)  评论(0编辑  收藏  举报

导航