Original Post
Here's the problema:
I have a dialog box in which I want the user to be able to set the password. I have two text boxes and am capable of retreiving and storing the input (simple). Now I'd like to be able to compare the two and see whether or not they're the same. (a confirm test just you see everywhere else you have to put in a password). Seems simple enough and I'm guessing I just haven't thought this through enough and I'm just complaining to everyone else, but with my method.. I GetDlgItemText on both and store them. I then compare the strings, and if they are not the same, pop-up an error MessageBox. Well.. since both have nothing in them until you type, the string must contain a NULL or null-terminator or something along those lines (please inform me if I'm wrong). After you put something in the first box, the program immediatly spits out the error because.. the strings are no longer equal! I thought I had a fix, and I added a while(string != NULL) loop, to make sure this didn't occur. Seemed to work.. when I was able to tab down to the next box w/o an error message. Then guess what.. it locks up on me
I have no idea why.. and I don't think it could be computer-specific
since it was tried on a friend's computer with the exact same problem. I think I'm pretty close to getting
it fully operational and I thought my while loop would be close, but I'm afraid I've thrown it into something
infinite w/o realizing what I'm doing.
Sorry if this is a n00bish question, but I've done some concentrating on it, and I'm
not sure what's going on. Could use some help
[edited by - chimaera on July 29, 2002 10:17:44 PM]
I have a dialog box in which I want the user to be able to set the password. I have two text boxes and am capable of retreiving and storing the input (simple). Now I'd like to be able to compare the two and see whether or not they're the same. (a confirm test just you see everywhere else you have to put in a password). Seems simple enough and I'm guessing I just haven't thought this through enough and I'm just complaining to everyone else, but with my method.. I GetDlgItemText on both and store them. I then compare the strings, and if they are not the same, pop-up an error MessageBox. Well.. since both have nothing in them until you type, the string must contain a NULL or null-terminator or something along those lines (please inform me if I'm wrong). After you put something in the first box, the program immediatly spits out the error because.. the strings are no longer equal! I thought I had a fix, and I added a while(string != NULL) loop, to make sure this didn't occur. Seemed to work.. when I was able to tab down to the next box w/o an error message. Then guess what.. it locks up on me