I try to register a custom filter for DirectShow but windows won’t register it correctly.
When I run a “ASSERT Failed” box shows up telling me:
g_hInst is NULL at Line 388 in file "dllsetup.cpp"
The file is located in the Microft SKD directory in the usual samples..\dshow\baseclasses folder. When pressing “Yes” the regsvr32.exe returns successfully.
I checked the registry entry with regedit and the file path in InProcServer32 is set to the directory of regsvr32.exe itself. (which confirms the missing HINSTANCE). DllRegisterServer needs a valid DLL-instance but cant get it…but WHY?
I am stuck because of this wrong registy entry the filter cannot be added to any filter graph (error message: Error in DLL –> which means it calls regsvr32.exe to “find the filter”)
From include/BaseClasses/dllsetup.cpp:
Not a lot of possible failure modes, the comment is pretty explicit. You probably simply forgot to call DllEntryPoint() in your DllMain() function. Which is called as soon as regsvr32.exe loads the DLL. Use the debugger in case of doubt. Project + Properties, Debugging, set the Command to c:\windows\system32\regsvr32.exe and set a breakpoint on your DllMain() function. Press F5.