问题描述
大家好,
我在下面的情景中需要一些帮助:
我创建了MFC C ++中Visual Studio 2010中基于对话框的应用程序。我的主对话框是模态的,我有一个菜单,右键单击我的对话框。
在其中一个菜单中,我做了一些处理并显示另一个对话框是没有模式的。在此处理过程中,用户应该能够:
1.单击主对话框的任何其他菜单。
2.如果在主对话框上点击关闭,它应该等待此处理完成并在完成处理完成后全部关闭。
3.应该能够重复相同的过程n次(例如,第二个无模式对话框可以在1个以上打开根据处理和选项选择不同结果的实例)。
为此,我尝试使用Multithread,我的第二个无模式对话框中的每一个都可以连接到一个不同的线程和主对话也可以保持活动状态,在此处理期间可以访问其所有菜单。
问题:我无法确定线程是否正确退出,析构函数我的第二个无模式对话框没有得到断点。应用程序以exitcode关闭,因为2是我的观察结果..
我想了解有关MultiThreading的更多信息,这是最佳解决方案还是其他任何参考建议?
提前谢谢..
紧急删除 - OriginalGriff [/ edit]
Hi All,
I need some help on my below scenario:
I have created a dialog based application in Visual Studio 2010 in MFC C++. My Main Dialog is Modal and I have a Menu that displays on Right Click on my Dialog.
In one of the Menu, I do some processing and display another Dialog which is modeless. During this processing, User should be able to:
1. Click on any other menu of Main Dialog.
2. If Close is hit on the Main Dialog, it should wait until this processing is completed and Close All once processing is completed.
3. Should be able to repeat same process n number of times (for eg. The 2nd Modeless dialog can be opened in more than 1 instance with different result as per processing and option chosen).
For this, I have tried to use Multithread where each of my 2nd Modeless dialog can be hooked up in a different thread & Main Dialog can also be kept alive with all its Menu accessible during this processing.
Problem: I am not able to determine if the thread exited correctly, destructor of my 2nd modeless dialog is not getting a breakpoint hit. The application closes with exitcode as 2 are my observations..
I want to learn more about MultiThreading and will this be the best solution or any other references are suggested?
Thank you in advance..
[edit]Urgency deleted - OriginalGriff[/edit]
推荐答案
这篇关于MFC Parent&儿童对话 - 像多线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!