-
June 24th, 2007, 01:13 PM
#1
modeless child and main dialog communication
Dear All;
I have a slight problem which i am sure it will be straight forward for you to solve.
I have a modeless child box in which the user inputs information. My question is so how do i stop the program from completing the execution until the data which has been entered is returned to the main application.
Method A{
invoke modelless box;
method B;
}
How do i stop the program from continuing the execution until the modeless box has been dismissed, only then method B can be executed.
Many thanx
-
June 24th, 2007, 03:46 PM
#2
Re: modeless child and main dialog communication
Usually the communication between two windows is made by using (user-defined) messages.
-
June 24th, 2007, 03:52 PM
#3
Re: modeless child and main dialog communication
Originally Posted by ovidiucucu
Usually the communication between two windows is made by using (user-defined) messages.
I know that and i have done it. My question is how do i stop the execution of the program until the user has entered the data and dismissed the modeless dialog box.
again:
Method A{
invoke modelless box;
method B;
}
how do i stop the execution of method B until the modeless box has been dismissed?
-
June 24th, 2007, 03:55 PM
#4
Re: modeless child and main dialog communication
For that purpose were invented the modal dialogs.
// it's seems you have to review a little your application "design".
-
June 24th, 2007, 03:56 PM
#5
Re: modeless child and main dialog communication
Either use a modal box or add loop where you wait on termination (messy compared to a modal box)
-
June 24th, 2007, 04:09 PM
#6
Re: modeless child and main dialog communication
thanx,
i have tried a modal box
CModalBox* modalBox;
modalBox = new ModalBox(this);
modalBox->DoModal();
This creates the a modal dialog and freezez the main application which is what i want. But once i dismiss the modal box i get an assertion!!!
any ideas how to fix this problem?
-
June 24th, 2007, 04:49 PM
#7
Re: modeless child and main dialog communication
Are you calling DestroyWindow() in CModalBox code?
Last edited by S_M_A; June 25th, 2007 at 12:35 AM.
-
June 25th, 2007, 01:41 AM
#8
Re: modeless child and main dialog communication
Originally Posted by llp00na
thanx,
i have tried a modal box
CModalBox* modalBox;
modalBox = new ModalBox(this);
modalBox->DoModal();
any ideas how to fix this problem?
Hi friend,
I would suggest you to do like below:-
Code:
CModalBox modalBox;
modalBox->m_pParent = this;
//m_pParent is your own pointer for your parent dialog in your child dialog.
//add your info to the pointer, simply. I expect you could understand
modalBox.DoModal();
Why dont you go for this code. why do you go for new in your code.
If you want to pass info from your main dialog to child dialog then just take a pointer in your child dialog. like this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|