Is it possible to create an instance of a COM object with just the dll and no regsvr32?
My main goal here is to create an instance of a directshow filter and insert it into my graph-but I don't want to us regsvr32 to register the filter. The filter will be in a dll/ax that will be distributed with my application and will be present in my path. I will know the CLSID as well.
So basically all I need is a way to create an instance of the type while just having the dll/ax and the CLSID. Is this possible in C#?
Sounds like you want to use registration-free COM.
It's possible, LoadLibrary() and GetProcAddress to the get the DllGetClassObject() entrypoint. You are bypassing a bunch of COM plumbing code that was designed to make you fall into the pit of success. Especially the stuff that takes care of the ThreadingModel. Or the tricks you can use to make 32-bit code run in a 64-bit process, tends to be important with video.
Using reg-free COM with a manifest can make you fall back into that pit.
When you create a COM instance, Windows looks in the registry, finds out what dll to load, how to load it, and then loads the dll and finds the class you were looking for. If you want to skip this lookup algorithm, then you have to implement it, and I don't think it's easy. But certainly doable.
UPDATE: look for the CoLoadLibrary function, maybe it's not that hard after all. I think that COM servers call CoRegisterClassObject when they are loaded, that's how Windows find them, and you can call CoGetClassObject. I'm still in the dark, though, so go ahead and read MSDN.