首页 > 代码库 > DirectX--Filter属性页的调用
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;//查找Filter接口,只有一个?
HRESULT hrQuery = pFilter->QueryInterface(IID_IVideoWindow, (void**)&pUnk);
if (SUCCEEDED(hrQuery))
{
pUnk->Release();
pEnum->Release();
break ;
}
// pFilter->Release();
}
// pEnum->Release();
//
ISpecifyPropertyPages *pProp = NULL;//查询接口
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);//显示Filter名称
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);
}
}
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;//查找Filter接口,只有一个?
HRESULT hrQuery = pFilter->QueryInterface(IID_IVideoWindow, (void**)&pUnk);
if (SUCCEEDED(hrQuery))
{
pUnk->Release();
pEnum->Release();
break ;
}
// pFilter->Release();
}
// pEnum->Release();
//
ISpecifyPropertyPages *pProp = NULL;//查询接口
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);//显示Filter名称
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);
}
}
DirectX--Filter属性页的调用
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。