=> First, I should say I'm testing my codes in VC++2005 (in Vista), and I haven't installed VC++6.
=> Calling a function of a dialog, "is just calling a function of a dialog's class instance", like any other classes (if you have access to a class(for static funcs) or an instance of that (for call with that object), you can call methods of that without problem). Here, the difference is not in 'syntax' it's in 'Run_Time' behavior and what the functions do, that the question is : "can we call a method after another one ?", but where you are calling, itself, is not important.
=> When you create and show a modal dialog_box (instead of a modeless one), you want to force user to respond to the modal_box then he can work with the main window. I tested 'ShowWindow( SW_HIDE )' : when I call it in a modal_box (for EX, in a button's click_func), modal_box will disappear and just the main_window remains on the screen (you should minimize all other windows to see that). But I can't interact with the main_win, since my modal_box is there but hidden! you can show that again with ShowWindow( SW_SHOW ), for an example app :
// click_event for 'Test' button
void CMyDlg::OnTestClickedBtn() // click_func for a button in the modal_box (CMyDlg)
{
ShowWindow( SW_HIDE );
Sleep( 3000 ); // wait 3000 milliseconds (3 seconds)
ShowWindow( SW_SHOW );
}
// click_event for 'ShowModal' button
void CMainDlg::OnShowModalClickedBtn() // click_func for a button in the main_win (CMainDlg)
{
CMyDlg dlg;
dlg.DoModal();
}
When you run the app, and click the 'ShowModal' button, your modal_box will appear. Then when you click on the 'Test' button, the modal_box will disappear and after 3 seconds it will appear again. During those 3 seconds, you can't interact with main_win. It's the nature of a modal dialog_box, and it's not in a loop.
Enter your message below
Sign in or Join us (it's free).