how to link 2 dialogs in one application?
i'm a fresh learner in the mfc, vc++ and i'm doing a project that needed to include several dialogs inside the application, however, i cannot link the dialogs together such as when i click on one of the button of the first dialog box, the second dialog box will appear.
i know that to link them together, i need to include some coding inside the first dialog's button, but, after i searched from the internet and asked some of my lecturers, they can't even give me the answer on how the linking can be done...
if anyone know how to do it, please reply me as it is one of the important part of my project, thanks!!
[652 byte] By [
yeefarn] at [2007-11-18 17:41:17]

# 1 Re: how to link 2 dialogs in one application?
Maybe I do not understand the problem here...but
void CDialogOne::OnButtonClick()
{
CDialogTwo Dialog;
Dialog.DoMadal();
}
# 2 Re: how to link 2 dialogs in one application?
what i meant is - in vb, we may link 2 forms by form2.show, form1.hide... what about if i wanna do this in vc++ by using the dialog based application?
# 3 Re: how to link 2 dialogs in one application?
Originally posted by yeefarn
what i meant is - in vb, we may link 2 forms by form2.show, form1.hide... what about if i wanna do this in vc++ by using the dialog based application?
Well...I am not sure how Visual Basic does that of the top of my head, however, if you want to show a second dialog from the first one and the first should not be seen while displaying the first one...
void CDialogOne::OnButtonClick()
{
// Hide first dialog
PostMessage(WM_SHOWWINDOW, FALSE, SW_PARENTCLOSING);
// Show second dialog
CDialogTwo Dialog;
Dialog.DoMadal();
// Show first dialog
ShowWindow();
}
# 4 Re: how to link 2 dialogs in one application?
is the .domodal is just for the dialog as the second window? what about if i want to put a menu as my second window? i cannot find any .domodal in the menu classwizard, so, i really donno how to call a menu by click a button which reside in the dialog...
# 5 Re: how to link 2 dialogs in one application?
Originally posted by yeefarn
is the .domodal is just for the dialog as the second window? what about if i want to put a menu as my second window? i cannot find any .domodal in the menu classwizard, so, i really donno how to call a menu by click a button which reside in the dialog...
Sorry...but I do not understand...maybe you need to elaborate a little bit further on what you are actually trying to accomplish...
# 6 Re: how to link 2 dialogs in one application?
hmm... .domodal is normally for dialog to call another dialog, rite? means if i got a button call "ok" in the first dialog, when i click it, the second dialog will appear...
but what if when i click on the "ok", a menu will appear? is it possible?
# 7 Re: how to link 2 dialogs in one application?
Originally posted by yeefarn
but what if when i click on the "ok", a menu will appear? is it possible?
Okay...I see...yes, it is possible...however, you might want to take a look at the following FAQ (http://www.dev-archive.com/forum/showthread.php?s=&threadid=267664) first. Many times it is better to simply use a SDI application instead which already provides a menu etc.
# 8 Re: how to link 2 dialogs in one application?
i found that most of the twain app are done by menu, is there any sample code of twain app is done by dialog?