المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Problem using MFC to create multiple CDialog threads



C++ Programming
02-23-2010, 04:00 AM
The problem I have is essentially very simple.

I need to have multiple CDialog thread in my application that do not lock the primary UI thread. Their purpose will be to display specific data in each one.

My problem is that although I have been able to achieve this for one of the dialogs by

public:
CSimulator thSim;
...

thSim.CreateThread();

but any attempt I make to repeat this approach does not give me the dialog although no errors are generated at compile or runtime.


I have also tried using the OnInitDialog() of my main dialog but this just results in the main dialog having the child dialog pasted over it. Not pretty.

Ultimately I am planning to use an SDI for the main interface with CDialog's for the children. This would allow the child dialogs to be arranged across multiple montiors independantly of the main UI.

Whilst MFC is quite an old thing to be using I have to be sure the application will run on ANY Windows platform without having to worry too much about dependancies (i.e. from XP to Windows 7). Also the target machines are tightly controlled so adding .Net to them is a no go before anyone suggests it.

So does anyone have any suggestions how best to create and manage multiple CDialog's?


Many thanksAlan