Click here to Skip to main content
16,005,037 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Get File Extension Pin
Randor 26-Apr-12 18:23
professional Randor 26-Apr-12 18:23 
GeneralRe: Get File Extension Pin
Le Quang Long27-Apr-12 15:10
Le Quang Long27-Apr-12 15:10 
GeneralRe: Get File Extension Pin
Randor 28-Apr-12 0:14
professional Randor 28-Apr-12 0:14 
AnswerRe: Get File Extension Pin
JohnCz29-Apr-12 4:28
JohnCz29-Apr-12 4:28 
GeneralRe: Get File Extension Pin
jkirkerx29-Apr-12 9:27
professionaljkirkerx29-Apr-12 9:27 
GeneralCALLING A NEW DIALOG Pin
Le Quang Long25-Apr-12 4:01
Le Quang Long25-Apr-12 4:01 
AnswerRe: CALLING A NEW DIALOG Pin
Albert Holguin25-Apr-12 4:15
professionalAlbert Holguin25-Apr-12 4:15 
GeneralRe: CALLING A NEW DIALOG Pin
JohnCz29-Apr-12 4:54
JohnCz29-Apr-12 4:54 
I am not sure why check for valid password in OnInitDlg, while it seems that it should be checked before main dialog is invoked. No need for posting any messages to the thread.

Besides, log in dialog should not be checked for cancel only but validate password and/or username.
This code snippet shows how this can be done:

C++
	CLoginDlg loginDlg;
	loginDlg.DoModal();
	INT_PTR nResponse = loginDlg.DoModal();

	if(nResponse == IDCANCEL)
	{
		return FALSE; // canceled exit app, terminate
	}
	
	if(loginDlg.m_csUser.CompareNoCase(lpszUser))
	{
		return FALSE; // no match exit app, terminate
	}

	if(loginDlg.m_csPassword.Compare(lpszPassword))
	{
		return FALSE; // no match exit app, terminate
	}

	CMainDlg dlg;
	m_pMainWnd = &dlg;
	INT_PTR nResponse = dlg.DoModal();
.
.
.

JohnCz

GeneralRe: CALLING A NEW DIALOG Pin
Maximilien25-Apr-12 5:28
Maximilien25-Apr-12 5:28 
GeneralRe: CALLING A NEW DIALOG Pin
Chris Meech25-Apr-12 7:30
Chris Meech25-Apr-12 7:30 
GeneralRe: CALLING A NEW DIALOG Pin
Le Quang Long27-Apr-12 15:17
Le Quang Long27-Apr-12 15:17 
GeneralRe: CALLING A NEW DIALOG Pin
Le Quang Long28-Apr-12 18:10
Le Quang Long28-Apr-12 18:10 
GeneralRe: CALLING A NEW DIALOG Pin
David Crow25-Apr-12 5:40
David Crow25-Apr-12 5:40 
GeneralRe: CALLING A NEW DIALOG Pin
Le Quang Long25-Apr-12 14:29
Le Quang Long25-Apr-12 14:29 
GeneralRe: CALLING A NEW DIALOG Pin
Le Quang Long25-Apr-12 14:30
Le Quang Long25-Apr-12 14:30 
GeneralRe: CALLING A NEW DIALOG Pin
Le Quang Long25-Apr-12 14:32
Le Quang Long25-Apr-12 14:32 
GeneralRe: CALLING A NEW DIALOG Pin
Richard MacCutchan25-Apr-12 21:16
mveRichard MacCutchan25-Apr-12 21:16 
Questionwhy need write itself hashtable? Pin
yu-jian24-Apr-12 20:27
yu-jian24-Apr-12 20:27 
AnswerRe: why need write itself hashtable? Pin
Richard MacCutchan24-Apr-12 22:34
mveRichard MacCutchan24-Apr-12 22:34 
QuestionSelecting median Pin
a1_shay24-Apr-12 3:12
a1_shay24-Apr-12 3:12 
GeneralRe: Selecting median Pin
Aescleal24-Apr-12 4:10
Aescleal24-Apr-12 4:10 
GeneralRe: Selecting median Pin
a1_shay24-Apr-12 4:32
a1_shay24-Apr-12 4:32 
AnswerRe: Selecting median Pin
Aescleal24-Apr-12 5:48
Aescleal24-Apr-12 5:48 
GeneralRe: Selecting median Pin
a1_shay24-Apr-12 10:12
a1_shay24-Apr-12 10:12 
GeneralRe: Selecting median Pin
Stefan_Lang27-Apr-12 6:54
Stefan_Lang27-Apr-12 6:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.