如何将exe应用程序作为新应用程序的一部分运行? [英] How to run an exe application as part of new application?

查看:89
本文介绍了如何将exe应用程序作为新应用程序的一部分运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以单独运行的应用程序.
我想将它用作新应用程序的一部分.
例如:
A.exe是可以单独运行的应用程序.
B.exe是一个新应用程序.

在B.exe中,有一个MDI表单.
我想使用A.exe作为主窗体的子窗体运行.

我能意识到吗?或者,还有其他方法可以将A.exe用作B.exe的一部分吗?
能给我一些示例代码吗?
我使用C#.

I have a application which can run alone.
And I want to use It as a part of a new application.
For example:
A.exe is the application which can run alone.
B.exe is a new application.

In B.exe, there is a MDI form.
I want to use A.exe run as a child form of the main form.

Can I realize it? Or,is there another way to use A.exe as a part of B.exe?
Can you give me some sample code?
I use C#.

推荐答案

This thread[^] has some suggestions, but as it also says they do not work for all application.


否.你做不到.

您需要将A.exe重新编码为DLL并从那里使用它.
No. You can''t do it.

You would need to recode A.exe into a DLL and use it from there.


简单的回答是,您不能这样做.

但是,如果您删除了将A.exe用作子窗体的要求,则可以做的事情很少.假设A.exe执行了某些操作或执行了一些处理,则可以将A.exe保留原样,然后从B.exe生成它.这并不意味着它以子窗体形式运行,而是完整的自包含exe文件.优点是您无需更改任何内容(或在A.exe中至少不需要更改)

如果您坚持要使用它的子窗体,那么请遵循OriginalGriff的建议.
The simple answer is NO you can not do it.

But if you remove the requirement of using A.exe as child form, there are few things you can do. Say A.exe does some actions or performs some processing, you could leave A.exe as is and spawn it from B.exe. This does not mean it is running as child form, rather a full fledged self contained exe. The advantage is you don''t have to change any ( or at least very little in A.exe)

Where as if you insist on using it child form, then follow what OriginalGriff suggested.


这篇关于如何将exe应用程序作为新应用程序的一部分运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆