如何在另一个解决方案中将解决方案作为子窗口导入 [英] How to import a solution in another solution as a child window

查看:102
本文介绍了如何在另一个解决方案中将解决方案作为子窗口导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用MFC C ++开发了Windows应用程序.

我的问题是:
如何将开发的应用程序(2)导入另一个应用程序(1).
当我按下application(1)上的按钮时,application(2)必须作为子窗口运行.

我不想打开应用程序(2),但它必须是一个应用程序.

这可能吗?我用过google,但没找到任何东西.


提前谢谢.

此致,Michael.

I developed a Windows application in MFC C++.

My question is:
How can I import the developed application(2) in another application(1).
When I push a button on application(1) , application(2) must run as a child window.

I don''t want to open the application(2), but it has to be one app.

Is this possible? I used google, but didn''t find anything.


Thanks in advance.

Regards, Michael.

推荐答案

这不是解决方案内部的解决方案,它是其中包含一个或多个项目的解决方案.另外,您所做的与解决方案或项目的结构并没有真正的关系.您当然不能清楚地区分编译时间与加载时间和运行时间,还是项目与可执行文件.

现在,您当然可以使用Windows API SetParent ^ ].

现在,帮自己一个忙:永远不要这样做!.这些将作为两个不同的过程运行;但是您将一起运行它们.您可以出于好奇或出于某些实验目的而执行此操作,但是您如何希望这些过程进行交流呢?您是否听说过流程是完全隔离的?您将必须使用一些IPC来集成它们.您将比其他方面花费更多的精力进行交流,尤其是-请您谅解我-基于您对技术水平的了解.

我最喜欢的基本原则之一是:开发软件,不要集成".您需要开发不同的组件,但要在一个UI和一个流程中使用它们.简而言之,如果您想要可重用和独立的组件,请将它们放在不同的DLL中,而不要放在不同的EXE中,因为不同的EXE将作为不同的进程运行.不要做.最好将时间花在一些有用的事情上.

祝你好运,
—SA
This is not a solution inside solution, this is a solution with one or more projects in it. Also, what you do is not really related with the structure of the solution or projects. You certainly do not clearly distinguish compile time from load time and run time, a project from executables.

Now, you can certainly run one application as a child window of another application using Windows API SetParent, http://msdn.microsoft.com/en-us/library/windows/desktop/ms633541%28v=vs.85%29.aspx[^].

Now, do yourself a great favor: never ever do it!. Those will run as two different processes; but you are going to run them together. You can do it out of curiosity or with some experimental purposes, but how do you want these processes communicate? Did you ever heard that the processes are well isolated? You will have to use some IPC to integrate them. You will spend much more effort for communication than for everything else, especially — please forgive me for this note — with your level of understanding technology.

One of the my favorite basic principles is: "Develop software, don''t integrate". You need to develop different components, but use them in one UI and one process. Simply put, if you want reusable and independent components, put them in different DLLs, but not in different EXEs, as different EXEs will be run as different processes; don''t do it. Better spend your time for something useful.

Good luck,
—SA





我认为您必须将应用程序1和2包装在可以由父应用程序"管理的组件上.也许您必须考虑使其继承于类似Window的类.

为此,我建议您考虑装饰器"设计模式,它有助于您解决问题.

装饰器设计模式说明 [ ^ ]


最好的问候.
Hi,


I think that you must wrap your application 1 and 2 on a component that could be managed by a "parent application". May be you must think to make it inherit from Window-like class.

To do this I suggest to you to think about the "decorator" design pattern, it cuold help you to solve your problem.

Decorator Design pattern explanation[^]


Best regards.


这篇关于如何在另一个解决方案中将解决方案作为子窗口导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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