Search code examples
c++windowsvisual-studiointernet-explorerwxwidgets

How to get Internet Explorer in a wxWidgets application?


Currently using wxHTML to display a remote web page in a C++ Windows wxWidgets based application.

However, I need more advanced features like rudimentary CSS styling and JavaScript. The easiest way, I guess, would be to embed Internet Explorer. Keeping the .exe size of the application small is key, so I don't think wxWebConnect is a good fit.

How can I do this? I found some references to using ActiveX to embed IE in a wxWidget application, but I'm unable to find any examples or documentation, or anything.

Update: The reason why it is using wxWidgets are historical. Cross-plattform issues is no concern, it should only run in Windows.


Solution

  • I've done precisely this. It's fairly straightforward. Essentially, you host the MSHTML ActiveX control. Internet Explorer takes that control, and adds buttons, a history, new window functionality, tabs, etcetera. However, all the rendering, DOM, and Javascript parts are handled by the MSHTML component.

    The wxActiveX component will take care of the practical bits of ActiveX hosting. wxIE apparently is a derived class that combines the wxActiveX widget with the MSHTML control, and adds a bit of polish. YMMV.