Sign in to follow this  

Call dialog from within dialog

This topic is 4601 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

If I need to create a dialog from withing a dialog's callback procedure, what do I do? I tried this from within the "parent" dialog's CALLBACK, which created the controls that wereon the dialog but not the dialog itself (a very weird error):
HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL);

DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOGCHILD), NULL, ChildProc);

How should I change it? Thanks.

Share this post


Link to post
Share on other sites
Dialogs aren't really supposed to "nest"; you probably should rethink your UI.

However, you might arrange for the main code to throw up a second dialog right away after the first is dismissed, depending on what was selected...

Share this post


Link to post
Share on other sites
well, the main part of the program is on a single dialog box, but it needs to create an about box and stuff... it worked if they used the parent dialog's CALLBACK. I guess I'll just do this - it works.

Share this post


Link to post
Share on other sites
It is possible to create a dialog from within the window procedure of another. If the second dialog returns an error, what did GetLastError() return? If you have any 'uncommon' controls on it, have you called InitCommonControls[Ex]() first?

Share this post


Link to post
Share on other sites

This topic is 4601 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this