How do I convert an ActiveX project (web browser) to a static library project?

I have an ActiveX component that contains a control (a web browser control embedded in a combo control dialog box) to access a specific URL. The URL to the ActiveX component can be used in other MFC or VB projects. Usage - Register ActiveX Control (use regsvr32 cmd) and then insert control into dialog using "Insert ActiveX Control".

I am now planning to convert an ActiveX component to a static library with the same browser window and web access functionality. Wondering how to do this? Also, how the browser window (in the static library) can be used in other MFC projects. Is it via call functions? Is there a sample project?

I have used Microsoft.Net 2003 as a development tool.

Thank you in advance.

0


a source to share


1 answer


I'm a bit at a loss as to how much you think you can put all this in a static library.

It probably won't be as straightforward as you think. The wizard and code in VS / MFC / ATL that allows you to insert an ActiveX control in a dialog does a lot of the work for you. However, it does make certain assumptions about the nature of the site for the ActiveX control, such as how the message pump works, who is the owner window, the streaming model, and so on. They are known in the dialogue. In another context, this is not the case.



The correct way to do what you are doing is to leave it as an ActiveX control. Perhaps, if you have indicated what problem you are trying to solve by putting it in a static library, we can provide other options.

The WebBrowser ActiveX control is actually a wrapper for the shdocvw.dll library in the system32 folder. shdocvw.dll is the heart and soul of IE (and typically much of the Windows Explorer interface). This is all very strongly COM based, which has its own rules for loading libraries, etc. So the site (any application that wants to use your ActiveX control) really needs to be ActiveX / COM friendly anyway.

0


a source