I have an existing COM Exe Server, and VBA or .NET code calling it. We'd like to make it work w/o needing to install or modify the registry so that other users that are not admins on their machines can use it.
Let's assume changing/modifying the COM Exe Server is not possible (expensive).
Question 1: From what I undertand in Registering a Running EXE Server, the EXE server can call CoRegisterClassObject to register the CLSID in the class table. Does that mean clients should be able to CoGetClassObject from there? (even w/o registry entries for that type/class?)
Question 2: If the above is correct, my EXE Server uses CComModule (deprecated, yes) and I can see is is indeed calling CoRegisterClassObject. Is there a way to verify the class table so see that is is done correctly?
Question 3:
This is the snippet I am using. clsid and iid refer to the coresponding clsid and iid guids. It fails with Interface not registered (Exception from HRESULT: 0x80040155) in the call to CreateInstance. This makes me sad, any idea on what might be wrong?
var factory = UnsafeNativeMethods.CoGetClassObject(
clsid,
RegistrationClassContext.LocalServer,
IntPtr.Zero,
typeof(UnsafeNativeMethods.IClassFactory).GUID)
as UnsafeNativeMethods.IClassFactory;
factory.CreateInstance(null, ref iid, out obj);