Archived

This topic is now archived and is closed to further replies.

construct a dialog direct.

This topic is 5589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a dialog resource that name is IDD_GETPASS, and it contain a control IDC_PASS( CEdit control ), I was create dialog as: CDialog dialog( IDD_GETPASS ); Then run the dialog and get handle of IDC_PASS: dialog.DoModal(); CEdit *pass = ( CEdit * )dialog.GetDlgItem( IDC_PASS ); But the pass is always NULL.

Share this post


Link to post
Share on other sites
Don''t know much about MFC, but, when you call the method DoModal() the dialog is created, right?
A call to the creation of a modal dialog doesn''t return until the dialog is destroyed, so you''re actually trying to get the control''s handle after the dialog is long gone.


Goblineye Entertainment
The road to success is always under construction

Share this post


Link to post
Share on other sites