GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 14-Sep-2006, 15:53
mfc mfc is offline
New Member
 
Join Date: Sep 2006
Posts: 1
mfc is on a distinguished road

My Dialog close itself


Hi, I'm having the following problem:
I’ve build a dialog application. My main class creates the first dialog - login dialog.
Now, for each type of user, the application creates a unique dialog, for example:
CPP / C++ / C Code:
void CBankDlg::OnButtonLogin() {
……
	UpdateData(true);

	pIter_user_vector iter_begin = p_app->p_users_vector.begin();
	pIter_user_vector iter_end   = p_app->p_users_vector.end();

	
	for (; iter_begin != iter_end; ++iter_begin)
	{
		if ((*iter_begin)->GetUserName() == m_user_name &&
		            (*iter_begin)->GetUserPassword() == m_user_password)
		{
                  	CDialog *p_user_dialog = Factory::CreateUserDialog(*iter_begin);
			rst = p_user_dialog->DoModal();
			(*iter_begin)->DestroyUserDialog(p_user_dialog);
			break;
		}
	}
	m_user_name.Empty();
	m_user_password.Empty();
	UpdateData(false);		
	m_login_control.EnableWindow(false);
}

CPP / C++ / C Code:
CDialog* Banker::CreateUserDialog()
{
	return new BankerDialog();
}

Each of these secondary dialogs has a “Back” button that supposes to close itself and reopen the login dialog once again. The problem is that sometimes after clicking on the "Back" button on the secondary dialogs and inserting a new user in the login dialog, the login dialog just close itself and doesn't continue to create the next dialog.
How can I overcome this behavior?
The login dialog doesn’t suppose to close until the user will hit the “Close button”.

Please help
Last edited by LuciWiz : 15-Sep-2006 at 00:38. Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
 
 

Recent GIDBlogPython ebook by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Traversing multiple dialog boxes Chronocide MS Visual C++ / MFC Forum 0 04-Sep-2006 23:27
combox close on enter in vc++ dialog neo79 MS Visual C++ / MFC Forum 1 18-Aug-2006 09:06
getting data from dialog before close custo MS Visual C++ / MFC Forum 6 23-Mar-2006 23:58
dialog based application hezyse MS Visual C++ / MFC Forum 1 20-Mar-2005 18:16
Help! Some basal questions about MFC xutingnjupt MS Visual C++ / MFC Forum 1 05-Dec-2004 03:38

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 17:10.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.