简体   繁体   English

将.exe应用程序嵌入QT表单

[英]embedding .exe applications on a QT form

I wanted to know if its possible to embed other .exe applications on a QT form. 我想知道是否有可能在QT表单上嵌入其他.exe应用程序。 Say i have an app called foo.exe. 说我有一个名为foo.exe的应用程序。 Now I want to lauch foo.exe through my application. 现在,我想通过应用程序启动foo.exe。 I know I could do that using QProcess::startDetached() however I would like that program to run within my form.Is that possible ? 我知道我可以使用QProcess::startDetached()做到这一点,但是我希望该程序在我的表单中运行,这可能吗?

Believe what you want is a kind of "EMBED", there seems to be something done, but I can direct you to a few ways: 相信您想要的是一种“嵌入式”,似乎已经完成了一些工作,但是我可以指导您采取几种方法:

Cygwin Cygwin的

In X Window System we have o "X-Embed" X Window系统中,我们有“ X嵌入”

For Windows exists Cygwin/X (apparently to run "multi-threaded" in "google chrome" uses cygwin). 对于Windows,存在Cygwin / X (显然要在“ google chrome”中运行“多线程”使用cygwin)。

QT X11 Systems: http://qt-project.org/doc/qt-4.8/qvfb.html QT X11系统: http : //qt-project.org/doc/qt-4.8/qvfb.html

Nice example: http://arstechnica.com/information-technology/2009/03/experimental-process-per-tab-browser-created-with-qt-xembed/ (outdated) 很好的例子: http : //arstechnica.com/information-technology/2009/03/experimental-process-per-tab-browser-created-with-qt-xembed/ (已过时)

ActiveX 的ActiveX

You can create Activex Controls, see example: http://qt-project.org/doc/qt-4.8/activeqt-server.html 您可以创建Activex控件,请参见示例: http : //qt-project.org/doc/qt-4.8/activeqt-server.html


In two suggestions that you spent the programs you want to add to your main program should be created by you, in other words, programs that are not compiled with "Cygwin" or is not an "ActiveX" (QT you can add controls ActiveX, such as Internet Explorer or MSExcel). 在您要花掉要添加到主程序中的程序的两个建议中,应该由您自己创建,换句话说,不是用“ Cygwin”编译的程序或不是“ ActiveX”的程序(QT您可以添加控件ActiveX,例如Internet Explorer或MSExcel)。

Believe both examples programs work as "servers" and its main program as a "client", in other words, other processes need not necessarily one graphical interface, I believe the main software is who works the GUI part. 相信两个示例程序都可以作为“服务器”工作,而其主程序则可以作为“客户端”工作,换句话说,其他进程不一定需要一个图形界面,我相信主要的软件是谁在工作GUI部件。

For this reason the programs should be "embedded" created with the purpose of "embedding" 因此,应该以“嵌入”为目的创建“嵌入”程序


Alternative solution (DotNet and user32.dll) 替代解决方案(DotNet和user32.dll)

See article: 见文章:

http://www.codeproject.com/Articles/9123/Hosting-EXE-Applications-in-a-WinForm-project http://www.codeproject.com/Articles/9123/Hosting-EXE-Applications-in-a-WinForm-project

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

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