简体   繁体   English

如何在wxWidgets应用程序中获取Internet Explorer?

[英]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. 当前使用wxHTML在基于C ++ Windows wxWidgets的应用程序中显示远程网页。

However, I need more advanced features like rudimentary CSS styling and JavaScript. 但是,我需要更高级的功能,例如基本的CSS样式和JavaScript。 The easiest way, I guess, would be to embed Internet Explorer. 我猜,最简单的方法是嵌入Internet Explorer。 Keeping the .exe size of the application small is key, so I don't think wxWebConnect is a good fit. 使应用程序的.exe大小保持很小是关键,因此我认为wxWebConnect不适合。

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. 我找到了一些有关使用ActiveX将IE嵌入wxWidget应用程序中的参考,但是我找不到任何示例或文档,也找不到任何内容。

Update: The reason why it is using wxWidgets are historical. 更新:使用wxWidgets的原因是历史性的。 Cross-plattform issues is no concern, it should only run in Windows. 跨平台问题无关紧要,它只能在Windows中运行。

One of the main reasons for using wxWidgets over certain other widget libraries is that wxWindows is cross-platform compatible. 在某些其他窗口小部件库上使用wxWidgets的主要原因之一是wxWindows是跨平台兼容的。 Embedding IE would destroy that. 嵌入IE会破坏它。

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. 这意味着(a)这可能不是一个好主意(即使您现在不打算编写跨平台的代码,将来也可能会改变主意),并且(b)您不会找到其他人这样做,因此教程和示例将很难获得。

My suggestion would be to consider a cross-platform browser instead of IE; 我的建议是考虑使用跨平台浏览器而不是IE。 Firefox seems like the obvious choice. Firefox似乎是显而易见的选择。

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 考虑到这一点,我为您做了一个快速的google并提出了这个建议,看来它可能是您的解决方案: 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. [编辑]当然,基于Firefox的小部件将为您提供比当前版本的IE更好的CSS / JS / HTML渲染,因此这是使用它的另一个很好的理由。

[EDIT] Revisiting this answer because I stumbled upon a Webkit widget, which might also be worth checking out. [编辑]重新回答这个问题,因为我偶然发现了一个Webkit小部件,这也许也值得一试。 Here's the link I just found: http://wxwebkit.kosoftworks.com/ 这是我刚刚找到的链接: 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) (我知道这不会对OP产生任何影响,但是对发现此页面的其他人可能会有帮助)

I've done precisely this. 我正是这样做的。 It's fairly straightforward. 这很简单。 Essentially, you host the MSHTML ActiveX control. 本质上,您托管MSHTML ActiveX控件。 Internet Explorer takes that control, and adds buttons, a history, new window functionality, tabs, etcetera. Internet Explorer进行控制,并添加按钮,历史记录,新窗口功能,选项卡等。 However, all the rendering, DOM, and Javascript parts are handled by the MSHTML component. 但是,所有呈现,DOM和Javascript部分均由MSHTML组件处理。

The wxActiveX component will take care of the practical bits of ActiveX hosting. wxActiveX组件将处理ActiveX托管的实用部分。 wxIE apparently is a derived class that combines the wxActiveX widget with the MSHTML control, and adds a bit of polish. wxIE显然是派生类,它将wxActiveX小部件与MSHTML控件结合在一起,并增加了一些修饰。 YMMV. YMMV。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM