BartMan
2006-04-18 21:30:01 UTC
Greetings,
I was wondering if it is possible to add custom interfaces (ATL created) to
a render filter and make it so it is exposed by allowing the user to query
for it?
For example I was looking at the sampvid project in directshow, and noticed
the "NonDelegatingQueryInterface" function. I was wondering if I can also
expose a custom interface by using this method?
(ie:) Inside my render filter
CComPtr<IFoo> m_spIFoo; // Interface object created somewhere.
// Reference the IID_IFoo for the interface object.
STDMETHODIMP CVideoRenderer::NonDelegatingQueryInterface(REFIID riid,void
**ppv)
{
// ... Code removed to make eaiser for post
if (riid == IID_IFoo)
{
return m_spIFoo.CopyTo(ppv);
}
return E_FAIL;
}
Then the user could query for my filter for specific items:
CComPtr<IFoo> m_spTest;
m_spMyRenderFilter->QueryInterface(IID_Foo, (LPVOID *) &m_spTest);
Thanks in advance for any suggestions!
I was wondering if it is possible to add custom interfaces (ATL created) to
a render filter and make it so it is exposed by allowing the user to query
for it?
For example I was looking at the sampvid project in directshow, and noticed
the "NonDelegatingQueryInterface" function. I was wondering if I can also
expose a custom interface by using this method?
(ie:) Inside my render filter
CComPtr<IFoo> m_spIFoo; // Interface object created somewhere.
// Reference the IID_IFoo for the interface object.
STDMETHODIMP CVideoRenderer::NonDelegatingQueryInterface(REFIID riid,void
**ppv)
{
// ... Code removed to make eaiser for post
if (riid == IID_IFoo)
{
return m_spIFoo.CopyTo(ppv);
}
return E_FAIL;
}
Then the user could query for my filter for specific items:
CComPtr<IFoo> m_spTest;
m_spMyRenderFilter->QueryInterface(IID_Foo, (LPVOID *) &m_spTest);
Thanks in advance for any suggestions!