I created a text string variable and converted it to a password via the PasswordCtrl_ConvertFromString command.
The user enters a name into one text string and a password into the converted string.
When there is a login error, I send the user back to the same panel to try again.
Both strings contain the "incorrect' data entered previously and I wanted to clear that, so I used:
SetCtrlVal (LoginPanelHandle, LoginPANEL_User_Name_STRING, "");
SetCtrlVal (LoginPanelHandle, LoginPANEL_Password_STRING, "");
to clear the incorrect values from the GUI. That worked; however, when this is done, the command
PasswordCtrl_GetAttribute( LoginPanelHandle, LoginPANEL_Password_STRING,
ATTR_PASSWORD_VAL, &Password[0] );
does not function properly. If you enter the incorrect password (for example "x" ) and then go back to the panel
to try again and enter something else (for example "y"), the PasswordCtrl_GetAttribute command actually returns
"xy" as the value. I have also tried to strcpy " " into Password. That works, but once the Password is retrieved, it shows up as
"xy". If you try again and enter "z" as the password, the PasswordCtrl_GetAttribute command returns the value of "xyz".
Note, if I do not use SetCtrlVal (LoginPanelHandle, LoginPANEL_Password_STRING, "");
to clear out the GUI field, tho old password is there (in "****" form) and if the old one is backspaced and the
new one is entered, it works correctly.
What am I doing incorrectly? What is a way to blank out the fields for a 2nd attempt?
Should I just ignore it and let the user delete the improper password?