I thought I could access the interfaces with the Createoleobject method.
CreateOleObject() requires the DLL and its classes to be registered in the Windows Registry.
When CreateOleObject() is called, it:
- looks up the specified ProgID in the Registry to determine the associated CLSID.
- calls CoCreateInstance() for the CLSID, asking for an IDispatch interface
When CoCreateInstance() is called, it:
- looks up the CLSID in the Registry to determine the path of the DLL and loads it, if not already loaded.
- calls the DLL's exported DllGetClassObject() function to get an IClassFactory interface
- calls IClassFactory.CreateInstance() to retrieve the requested interface (IDispatch) for the specified CLSID.
So, if you want to use CreateOleObject(), it is not enough that your DLL simply implement an interface, it has to implement and register a full-on ActiveX-compatible CoClass and class factory, too.