The logic chain is here as follows:
CoCreateInstance
takesCLSID_Xxx
CLSID_Xxx
needs to not only be defined, but should be also properly served by your project- ... which means that you should have a
CFactoryTemplate
instance mapping CLSID to your class
- ... which means that you should have a
You can refer to one of the Windows SDK samples for details, I recommend EZRGB24
in particular.
You only show you have CLSID defined within the project. Class IFilterRotation
does not look good to me (you typically don't inherit I-thing from C-thing, but it's a naming matter though). You don't show if you have a CFactoryTemplate
, which I suppose you don't have.
However this all is true when you put your filter into DLL. In your case you don't seem to register COM class at all, so CoCreateInstance
does not work for you. Your options are either put the class into DLL, or CoRegisterClassObject
this class to enable its visibility for CoCreateInstance
, or create a simple C++ instance of the class (operator new or stack/static instance) which you then pass directly to AddFilter
.