c++comdirectshowregsvr32graphedit

DirectShow Filter error "Class is not registered"


Using the following code under my cpp/win32 project I get error "class is not registered"

hr = CoCreateInstance(CLSID_PIAsyncFile, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void**) &ppF);

if (SUCCEEDED(hr)) {

  hr = pGraph->AddFilter(ppF, L"My Async Source (File)");

}

This is not true,since my filter works just fine under GraphEdit and I can also find it using IFilterMapper2 enumerating monikers. I can also bind to object from the direct show filters successfully.

hr = pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&ppF);

So, what's wrong with the CoCreateInstance ?

PS:This is a 32bit filter that registered under a 64Bit Windows 7 system. In the registry I can also find the filter under sysWOW3264 (a mirror registry for 32-bit windows apps running on 64bit windows).

You can also refer and find the source code to my codeproject post at http://www.codeproject.com/Messages/4603967/Class-not-registered-error.aspx


Solution

  • Thanks to Roman R, the problem was the wrong CLSID declaration in my code.