CDialog::DoModal 
Author Message
 CDialog::DoModal

I've a little problem: I have a dialog I call with DoModal, but, once the
call is done, the dialog is empty (m_Wnd =0x00000000) and I can't get any
informations from it.

What shall I do???



Sat, 14 Feb 2004 22:08:03 GMT  
 CDialog::DoModal
That's correct. Your dialog box is dismissed and all its user interface
terminated, when the user clicks "OK" "Cancel" "ENTER" "ESC", etcetera.

A dialog box is a medium of communication with the user. It should work with
the user and from that interaction obtain information which would fit data
members on the dialog class. This approach will also enable you to change
the class to be a different thing, like a command-line interaction.



Sat, 14 Feb 2004 22:21:59 GMT  
 CDialog::DoModal
The hWnd is gone because the dialog has been closed and the window destroyed.

What you need to do is save the dialog's values to member variables in your
CDialog class during ONOK processing, then retrieve your data from the member
variables instead of the controls. If you use ClassWizard to bind variables to
the controls, then MFC will do this for you by calling UpdateData();

You can review Step 3 of the Scribble tutorial for a walkthrough of how to do
this.

Quote:

> I've a little problem: I have a dialog I call with DoModal, but, once the
> call is done, the dialog is empty (m_Wnd =0x00000000) and I can't get any
> informations from it.

Jim [VC/MFC MVP]
To send mail, change spam-me-not to msn


Sat, 14 Feb 2004 22:27:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CDialog::DoModal(), CDialog::EndDialog() Design Flaw

2. Q: CDialog::DoModal () fails

3. CDialog.DoModal problem

4. Help. CDialog::DoModal Fail in _beginthreadex

5. CDialog::DoModal() Behaviour

6. Invalid Page Fault from CDialog.DoModal()

7. Calling CDialog::DoModal crashes

8. CDialog::DoModal()

9. CDialog::DoModal() keyboard messages?????

10. HELP! CDialog/DoModal problems in regular DLL

11. CDialog::doModal

12. Problem with CDialog::DoModal()

 

 
Powered by phpBB® Forum Software