Solved

password verification

Posted on 2000-02-15
3
302 Views
Last Modified: 2010-04-10
I am a beginner in Visual C++. I need some help urgently. I have two edit boxes in a dialog box. Also there is an OK and CAncel button.
                      In one I am supposed to enter a password and in the other I need to confirm the password(that is I type that password once again). If
                      the two passwords match on pressing the OK button then it is fine, else I need a message box which pops up saying that the passwords
                      entered are not same and that we need to check the two passwords once again. Also, if any of the two boxes are blank we need a
                      message box to say that password needs to be entered. On pressing the Cancel button I should be back in the same window with the
                      fields for password and password confirmation cleared. Could someone please help me with writing this code please.


                      Could someone help me out on this fast please!
0
Comment
Question by:gopalanravi
  • 2
3 Comments
 

Author Comment

by:gopalanravi
ID: 2525594
Adjusted points to 100
0
 

Accepted Solution

by:
Stevex2 earned 100 total points
ID: 2525698
You could try this.

CString edit1;
CString edit2;
GetDlgItem(IDC_EDIT1)->GetWindowText(edit1);
GetDlgItem(IDC_EDIT2)->GetWindowText(edit2);
if(edit1 != edit2)
 AfxMessageBox("Passwords dont match");
if(edit1 == "" || edit2 ="")
 AfxMessageBox("Can not have blanks in passwords");
0
 

Expert Comment

by:Stevex2
ID: 2525700
and one more line
if(edit1 == edit2)
 //continue execution here
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now