Hi,
I'm get the password using form:
Code:
RESOURCE FORM r_smsexample_changecode_form
{
flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat ;
items =
{
DLG_LINE
{
type = EEikCtSecretEd;
prompt = OLD_CODE_TEXT;
id = ESMSExampleCIdOldCode;
control = SECRETED
{
num_letters = KMaxAccessCodeLength;
};
},
DLG_LINE
{
type = EEikCtSecretEd;
prompt = NEW_CODE_TEXT;
id = ESMSExampleCIdNewCode;
control = SECRETED
{
num_letters = KMaxAccessCodeLength;
};
},
DLG_LINE
{
type = EEikCtSecretEd;
prompt = RETYPE_CODE_TEXT;
id = ESMSExampleCIdRetypeCode;
control = SECRETED
{
num_letters = KMaxAccessCodeLength;
};
}
};
}
Then, I did compared the password.
Code:
// To compare new access code and old access code
void CSMSExampleChangeCode::ComparePassword(const TDesC& aOld, const TDesC& aNewp, const TDesC& aRetype)
{
// Check if fields is empty
if ((aOld.Length() == 0) || (aNewp.Length() == 0) || (aRetype.Length() == 0))
{
iView->NotifyMessageFieldEmptyL(KCodeEmpty);
}
else
{
if (aOld.Compare(aNewp) == 0) // Check if old and new access code is same
{
iView->NotifyMessageInvalidL(KCodeError);
}
else
{
if (aNewp.Compare(aRetype) == 0) // If new access code and retype is the same
{
// Here is code to save new access code!
// New code is saved
iView->NotifyMessageL(KChangeCode);
}
else
{
iView->NotifyMessageInvalidL(KCodeError);
}
}
}
}
Hope it helps... ;)