码迷,mamicode.com
首页 > 其他好文 > 详细

DirectX--Filter属性页的调用

时间:2014-12-18 09:12:45      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:style   ar   io   sp   for   on   log   bs   ef   

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);
}
}

DirectX--Filter属性页的调用

标签:style   ar   io   sp   for   on   log   bs   ef   

原文地址:http://blog.csdn.net/mao0514/article/details/42000957

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!