开发者

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 re开发者_C百科ferences 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.


One of the main reasons for using wxWidgets over certain other widget libraries is that wxWindows is cross-platform compatible. Embedding IE would destroy that.

This means that (a) it's probably not a great idea (even if you're not writing for cross-platform now, you may change your mind in the future), and (b) you won't find many other people doing it, so tutorials and examples will be hard to come by.

My suggestion would be to consider a cross-platform browser instead of IE; Firefox seems like the obvious choice.

With that in mind, I did a quick google for you and came up with this, which seems like it may be a solution for you: http://www.kirix.com/labs/wxwebconnect.html

Hope that helps.

[EDIT] Of course, a Firefox-based widget would give you much better CSS/JS/HTML rendering than current versions of IE, so that's another good reason to use it instead.

[EDIT] Revisiting this answer because I stumbled upon a Webkit widget, which might also be worth checking out. Here's the link I just found: http://wxwebkit.kosoftworks.com/
(I know this doesn't change anything for the OP, but it might be helpful for anyone else who finds this page)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜