Modeless Dialog Ending Help needed
-
Hi all, I have a Dialog based app that creates a Modal Dialog Box that then creates some modeless dialog's. What I need to know is when a modeless dialog exits, I wish it to pass a message back to the Modal Dialog when the modeless dialog Box has been finished with a EndDialog. Sorry for this being a simple question. But I have looked through a stack of samples, And couldn't find an example of this being done. Regardz Colin Davies
-
Hi all, I have a Dialog based app that creates a Modal Dialog Box that then creates some modeless dialog's. What I need to know is when a modeless dialog exits, I wish it to pass a message back to the Modal Dialog when the modeless dialog Box has been finished with a EndDialog. Sorry for this being a simple question. But I have looked through a stack of samples, And couldn't find an example of this being done. Regardz Colin Davies
You could pass a pointer to your modal dialog up to its child modeless dialog. Then place a function in your modal dialog that will allow you to set your message. Then from your modeless dialog you can call that function before you call enddialog. ================== The original message was: Hi all,
I have a Dialog based app that creates a Modal Dialog Box
that then creates some modeless dialog's.
What I need to know is when a modeless dialog exits,
I wish it to pass a message back to the Modal Dialog when the modeless dialog Box has been finished
with a EndDialog.Sorry for this being a simple question. But I have looked through a stack of samples, And couldn't find an example of this being done.
Regardz
Colin Davies
-
Hi all, I have a Dialog based app that creates a Modal Dialog Box that then creates some modeless dialog's. What I need to know is when a modeless dialog exits, I wish it to pass a message back to the Modal Dialog when the modeless dialog Box has been finished with a EndDialog. Sorry for this being a simple question. But I have looked through a stack of samples, And couldn't find an example of this being done. Regardz Colin Davies
Colin, Do not use EndDialog() with Modeless Dialogboxes. What you need to do is override the OnOK() and OnCancel() methods and call DestroyWindow(). As for passing a message back to the parent dialogbox, all you need to do is have a "MyParent" variable and do the type cast back to the parent class. Ex: (( CYourClassHere *) MyParent)->VariableOrMethodHere; ** Note ** : This assumes that your dialogs are CWnd based. - Mike P.S. - Any other questions - drop me an e-mail or pop a rely to this message ... ================== The original message was: Hi all,
I have a Dialog based app that creates a Modal Dialog Box
that then creates some modeless dialog's.
What I need to know is when a modeless dialog exits,
I wish it to pass a message back to the Modal Dialog when the modeless dialog Box has been finished
with a EndDialog.Sorry for this being a simple question. But I have looked through a stack of samples, And couldn't find an example of this being done.
Regardz
Colin Davies