MSVidCtl and IMSVidGraphSegmentContainer
- From: "developer" <I.BaZiliO.I@xxxxxxxxx>
- Date: 31 Oct 2006 02:45:17 -0800
Hello,
OS: WinXP SP2, DirectX 9c
Problem description:
MSVidCtl component, placed on form return conversion error if
IMSVidGraphSegmentContainer interface queried, but if I create control
"by hands" conversion pass with success.
Can anybody describe what is the problem here?
Some code attached below:
[VB] Add control to panel, place it on the form with name ctlTV. Then
in function
Dim tvSegment As IMSVidGraphSegmentContainer
Set tvSegment = ctlTV
Conversion error raised in the lone above. Same situation appears with
other languages if component placed on the form.
Next sample shows success conversion.
[C++]
HRESULT CreateMediaPlayer(HWND hWnd)
{
HRESULT result = S_OK;
CComHolder<IBaseFilter> pDeinterlace(CLSID_DeinterlaceFilter,
IID_IBaseFilter);
CComHolder<IMSVidCtl> m_pVideoControl(CLSID_MSVidCtl,
IID_IMSVidCtl);
CComQIPtr<IMSVidGraphSegmentContainer> pSeg(m_pVideoControl);
if (pSeg)
{
CComPtr<IGraphBuilder> pGraph;
result = pSeg->get_Graph(&pGraph);
if (SUCCEEDED(result) && pGraph)
{
::MessageBox(hWnd, _T("Info"), _T("Ok"), MB_OK);
}
}
return result;
}
where CComHolder is
template < class T >
class CComHolder
{
public:
CComHolder(CLSID clsid, CLSID iid) : m_pObject(0)
{
HRESULT result = CoCreateInstance(clsid, NULL,
CLSCTX_INPROC_SERVER, iid, (void **) &m_pObject);
if( !SUCCEEDED(result) )
throw CComError("Can't create object", result);
}
~CComHolder()
{
if(m_pObject) m_pObject->Release();
}
operator T *()
{
return m_pObject;
}
T * operator ->()
{
return m_pObject;
}
private:
T * m_pObject;
};
.
- Prev by Date: DirectShow Filters and windows media player On Smartphone Emulator
- Previous by thread: DirectShow Filters and windows media player On Smartphone Emulator
- Index(es):