help with custon transform filter

help with custon transform filter

Post by Neeraj Gar » Sun, 10 Jun 2001 14:59:05



Hi,

I have created a custom transform filter in directShow.  I have registered
the filter and it works perfectly fine when I use 'graph edit' to check it.

When I try using this filter in an application, I get an error stating that
CLSID_filtername was not found.  To counter this effect, I included the .h
file of the filter, which has the class ID.

Now I am getting errors in linking.

LNK2001: unresolved external symbol _CLSID_filtername.

I have tried including all the .lib files of the filter (present in the
filter project folder) in the project, but no luck.

An I doing something wrong or missing a key step?  Do I physically need to
add the filter name / CLSID to some other file?  Does this filter create a
lib or a dll that I need to reference, which I may be missing?  Has anyone
created a custom filter that worked?

I'll appreciate any suggestions or comments from anyone.

Thanks, in advance, for your help.

Neeraj Garg

 
 
 

help with custon transform filter

Post by Bernd Gronosta » Wed, 13 Jun 2001 00:11:46


The GUID of your filter is not found because of the external linkage of your
GUID (see DEFINE_GUID). In the code of the application using your filter,
insert code like this:

   static const GUID CLSID_filtername =
      { 0x1fd9911, ........

Bernd

 
 
 

help with custon transform filter

Post by Ingo Ralf Blu » Sat, 16 Jun 2001 00:38:52


Quote:> When I try using this filter in an application, I get an error stating that
> CLSID_filtername was not found.  To counter this effect, I included the .h
> file of the filter, which has the class ID.

Do the following in an implementation file (*.cpp)

#include <initguid.h>
#include <YourFilterIncludeFile.h>

As another poster said already, the GUID has external linkage. By including
initguid.h before your include file, the macro DEFINE_GUID creates a static
variable.

Make sure you have the above construct only once in your project, otherwise you
get duplicate defined symbols in your link step.

Regards Ingo