I am trying to loop through all the characters from a string in an edit box to check them against certain values.
I have a small program I am working on. It accepts a string from a simple edit box:
Very simple edit box like this:
Enter Password: _______________
I am doing this in a Dialog Box, not main window if that makes any difference.
First I initialize my variable as follows:
and then I assign the value using this:
Ultimately I would like my code to resemble something like this psuedocode:
------------ psuedocode begin ------------
Begin Loop
First character a "T" or "t"?
Yes, continue
No, MessageBox invalid.
Second character a "E" or "e"?
Yes, continue
No, MessageBox invalid.
Third character a "S" or "s"?
Yes, continue
No, MessageBox invalid.
Fourth character a "T" or "t"?
Yes, Valid Password MessageBox
No, MessageBox invalid.
End Loop
------------ psuedocode end ------------
The problem I am running into is this, when I do a strcmp against szPassword[1] I am getting an error. It is complaining about converting the data type.
Anybody have any pointers for me on this one? Thank you for reading this.
I have a small program I am working on. It accepts a string from a simple edit box:
Very simple edit box like this:
Enter Password: _______________
I am doing this in a Dialog Box, not main window if that makes any difference.
First I initialize my variable as follows:
Code:
char szPassword[25]={0};
Code:
GetDlgItemText(hWnd, IDC_PASSWORD, szPassword, 25);
------------ psuedocode begin ------------
Begin Loop
First character a "T" or "t"?
Yes, continue
No, MessageBox invalid.
Second character a "E" or "e"?
Yes, continue
No, MessageBox invalid.
Third character a "S" or "s"?
Yes, continue
No, MessageBox invalid.
Fourth character a "T" or "t"?
Yes, Valid Password MessageBox
No, MessageBox invalid.
End Loop
------------ psuedocode end ------------
The problem I am running into is this, when I do a strcmp against szPassword[1] I am getting an error. It is complaining about converting the data type.
Anybody have any pointers for me on this one? Thank you for reading this.