我想得到 Divx MPEG-4 DVD Video Decompressor解码器,请问是直接 CoCreateInstance还是通过枚举方法得到呢?
其中的CLSID是什么呀?
救命!!!!!!
------解决方案--------------------------------------------------------
可以直接用CoCreateInstance来创建,CLSID可以用GraphEdit工具看到。
------解决方案--------------------------------------------------------
HRESULT AddFilterByCLSID(
IGraphBuilder *pGraph, // Pointer to the Filter Graph Manager.
const GUID& clsid, // CLSID of the filter to create.
LPCWSTR wszName, // A name for the filter.
IBaseFilter **ppF) // Receives a pointer to the filter.
{
if (!pGraph || ! ppF) return E_POINTER;
*ppF = 0;
IBaseFilter *pF = 0;
HRESULT hr = CoCreateInstance(clsid, 0, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, reinterpret_cast <void**> (&pF));
if (SUCCEEDED(hr))
{
hr = pGraph-> AddFilter(pF, wszName);
if (SUCCEEDED(hr))
*ppF = pF;
else
pF-> Release();
}
return hr;
}
------解决方案--------------------------------------------------------
直接用CoCreateInstance来创建,CLSID可以用GraphEdit工具看到。