DirectX -- Filter property page call, directx -- filter

Source: Internet
Author: User

DirectX -- Filter property page call, directx -- filter
IEnumFilters * pEnum;
HRESULT hr;
If (pigb)
{
Hr = pigb-> EnumFilters (& pEnum );
If (FAILED (hr ))
{
Return;
}



IBaseFilter * pFilter = NULL;
While (pEnum-> Next (1, & pFilter, NULL) = S_ OK)
{
// Check for required interface
IUnknown * pUnk; // query the Filter interface. There is only one?
HRESULT hrQuery = pFilter-> QueryInterface (IID_IVideoWindow, (void **) & pUnk );
If (SUCCEEDED (hrQuery ))
{
PUnk-> Release ();
PEnum-> Release ();
Break;
}
// PFilter-> Release ();
}
// PEnum-> Release ();
//
ISpecifyPropertyPages * pProp = NULL; // query interface
Hr = pFilter-> QueryInterface (IID_ISpecifyPropertyPages, (void **) & pProp );
If (SUCCEEDED (hr ))
{
// Get the filter's name and IUnknown pointer.
FILTER_INFO FilterInfo;
Hr = pFilter-> QueryFilterInfo (& FilterInfo );
IUnknown * pFilterUnk;
PFilter-> QueryInterface (IID_IUnknown, (void **) & pFilterUnk );
//
CString str (FilterInfo. achName); // display the Filter Name
MessageBox (str );

// Show the page.
CAUUID caGUID;

PProp-> GetPages (& caGUID );
PProp-> Release ();
OleCreatePropertyFrame (
This-> GetSafeHwnd (), // Parent window
0, 0, // Reserved
FilterInfo. achName, // L "MAOMAO" // Caption for the dialog box
1, // Number of objects (just the filter)
& PFilterUnk, // Array of object pointers.
CaGUID. cElems, // Number of property pages
CaGUID. pElems, // Array of property page CLSIDs
0, // Locale identifier
0, NULL // Reserved
);

// Clean up.
PFilterUnk-> Release ();
FilterInfo. pGraph-> Release ();
CoTaskMemFree (caGUID. pElems );
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.