Statically Link ActiveX control
-
This is going to sound like a strange question, but I'm wondering if there is any way to statically link an activex control into an app. Basically, I would like my app to use one particular version of an ActiveX control, and one version only. If a subsequent installation installs a newer version of said control and registers it into a different location, I would like for my app to continue using the one it knows about. I want to do this to reduce the dependencies between different apps that use the same control. Is this possible? Basically, what I'm looking for is a way to bypass CWnd::CreateControl, and get a CWnd* for an activeX control that's linked into the project. Or, alternatively, call LoadLibrary with a particular path, and get the CWnd* for th control that way. I'm thinking maybe LoadLibrary, DllGetClassFactory and some other magic might make this possible. How does CWnd::CreateControl manage to do it? I would think it basicaly looks in the registry for the location of the control, calls LoadLibrary, then DlGetClassFactory, creates an instance of the object given the control's CSLID, and then . . . . what?