Windows 7 - Unable to load a custom filter

Asked By SALMA on 07-May-07 09:01 AM
Hi,
I am a newbie in DirectShow filters development. To start off
understanding the architecture of DirectShow filter, I decided to write a
transform filter for flash video file. For this, I started implementing the
IBaseFilter interface using ATL and ignoring the DirectShow filter base
classes. Then, I register the filter. But, when rendering the flash video
file it loads the filter but after successful querying the IBaseFilter it
returns E_NOINTERFACE. I do not know, what other interface I would have to
support.

I upload the code at the following file sharing site :-
http://rapidshare.com/files/29978528/FlvDecoder.zip.html


Thank you.




Michel Roujansky - DirectShow Consultant and Trainer replied on 07-May-07 12:20 PM
Not a very good idea to ignore the base classes ! Anyway, you need to
implement also :
IMediaFilter and IPersist (look at all the methods of the CBAseFilter
class).
SALMA replied on 08-May-07 02:44 AM
Thanks Michel for your reply but if you see the code, I implemented the
IMediaFilter and IPersist interface which is the base interface for
IBaseFilter.
Still, I do not know why it still gives me the E_NOINTERFACE error.
rep_movsd replied on 08-May-07 01:24 PM
Hi

Have you implemented the QueryInterface function properly ?
You need to check the riid parameter and return the interface pointer
if you support it.

If you have, just try running it under the debugger, and put a
breakpoint in queryinterface and watch the riid parameter, check for
which IIDs are asked.( visual studio shows the CLSID name in the watch
most of the times, if it doesnt, grep for the GUID values in the
header files to see what it is ).

See which one its failing for.

Vivek
SALMA replied on 09-May-07 02:11 AM
Hi,
I found the problem it was about registering the filter ThreadingModel
properly. Your filter should always be registered for multithreaded threading
model otherwise it will query for marshal interface. If you do not provide
custom marshaling interface pointers, it will simply throw an error
E_NOINTERFACE.
Thanks every one for helping me out.