Link to home
Create AccountLog in
Avatar of maximilia
maximiliaFlag for Singapore

asked on

DirectShow custom filter for windows mobile

I have built the custom sample grabber directshow filter successfully but i could not instantiate the custom filter.

It prompts error at CoCreateInstance command.
error C2065: 'CLSID_SampleGrabber' : undeclared identifier

I have registered the custom filter in the pocket pc registry entry.

Have I registered the filter correctly?
Did I miss any configurations for compiling and building the filter?

Anyone can help?
Thank you
 
Avatar of alexey_gusev
alexey_gusev
Flag of United Kingdom of Great Britain and Northern Ireland image

this CLSID_SampleGrabber should be defined somewhere in your code, otherwise you'll get an error. Maybe try to use IID_SampleGrabber instead
Avatar of maximilia

ASKER

I tried IID_SampleGrabber.
It prompts undeclared identifier too.

Anyway I can find this CLSID in my pocket pc registry entry HKEY_CLASSES_ROOT\CLSID\<filter GUID>

well, registry is not visible to your compiler, isn't it :)

what you can do is to define this CLSID - look for the format of GUID and define it in your application according to the value you have in the registry. look at the samples coming with SDK if you like
Yes, it is not visible.

So i define the COM class and its UUID this way

#ifdef __cplusplus
typedef class CSampleGrabber CSampleGrabber;
#endif

EXTERN_C const CLSID CLSID_SampleGrabber;

#ifdef __cplusplus

class DECLSPEC_UUID("xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
CSampleGrabber;
#endif

Is that the correct way? I look through the sample from the DirectX SDK. All of the samples are meant for desktop. So the implementation is different from windows mobile.


http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3704624&SiteID=1
According to the link above, I have to compile the custom filter and the compiler will generates <class name>_h.h file.

Then I include this header files to define the CLSID.
How can I compile this <class name>_h.h file?
I only have CSampleGrabber.dll, CSampleGrabber.exp, CSampleGrabber.exp, CSampleGrabber.lib and .obj, .pdb, and .idb files
ASKER CERTIFIED SOLUTION
Avatar of alexey_gusev
alexey_gusev
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer