简体   繁体   English

从HTML页面加载外部C ++函数

[英]loading an external c++ function from an HTML page

I am trying to develop an HTML page (internal of course) that can in some way be able to load another application. 我正在尝试开发一个HTML页面(当然是内部页面),该页面可以某种方式加载另一个应用程序。 I don't mind using any language to do that. 我不介意使用任何语言来做到这一点。 I am using a webkit interface to render the HTML page (well, it QTWebKit) and sadly it does not allow using ActiveXObject (JavaScript) to be used to call another app. 我正在使用Webkit界面来呈现HTML页面(嗯,它是QTWebKit),可惜它不允许使用ActiveXObject(JavaScript)来调用另一个应用程序。 I am not sure if this is possible but hopefully it is. 我不确定这是否可行,但希望如此。

As I said, I don't mind using any kind of script or methods to do that (as long as its user friendly). 就像我说的,我不介意使用任何脚本或方法来做到这一点(只要它对用户友好)。

So my question in short: Can I load an external c++/c# function from a dll and call the functions directly from an HTML page. 简而言之,我的问题是:我可以从dll加载外部c ++ / c#函数并直接从HTML页面调用这些函数。

With QtWebKit you can easily expose objects to script using QWebFrame::addToJavaScriptWindowObject() , see eg this blog post for an example. 使用QtWebKit,您可以使用QWebFrame::addToJavaScriptWindowObject()轻松地将对象公开给脚本,例如,请参见此博客文章中的示例。

If you want a plugin that works in all browsers except IE, use NPAPI or one of its wrappers. 如果您想要一个可在除IE之外的所有浏览器中使用的插件,请使用NPAPI或其包装之一。 If you want to support all browsers including IE, you can simplify your work by using a framework like FireBreath . 如果要支持包括IE在内的所有浏览器,则可以使用FireBreath之类的框架来简化您的工作。

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

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