Hey Guys,

I am not able to set the password for a Symbian device. I am using Nokia 6600 for my testing.
Following code snippets will give you an idea of what I am doing..

//===================================================
// Code to take input from user, oldpassword and newpassword that needs to be set
//====================================================

TBuf<KAknExQueryTextBufLength> oldpassword;
CAknTextQueryDialog* dlg =
new ( ELeave ) CAknTextQueryDialog(
oldpassword, CAknQueryDialog::ENoTone );
if ( ! dlg->ExecuteLD( R_DIALOG_OLD_PASSWORD_QUERY ) )
{
return;
}

Similarly, i get the new password as well.

//===================================================
// Set password, and enable password checking if not enabled.
//====================================================

if(Password::IsEnabled())
{
if(Password::Set(oldpassword, newpassword ))
{
// print message, password set
}
else
{
// print, error message saying password not set
}
}
else
{
// enable password checking
Password::SetEnabled(oldPassword, ETrue);
// set password
Password::Set(oldpassword, newpassword ) ;
}

Even though I get messages saying password is enabled and set, but actually it does not set any password.
Moreover, when I tried to check if password that I am trying to set is valid using Password::IsValid(), it always returns false i.e password is not valid, though Password::Set() return true :-(

Please let me know if I am missing anything. Any help will be really appreciated.

Thanks a lot,
Sachin