Changing an Existing Phone-Book Entry (Windows CE 5.0)
The RasRenameEntry function renames a phone-book entry in the registry, while the RasDeleteEntry function deletes an entry. To verify if the string is in the correct format, the application can use the RasValidateEntryName function.
To change a registry phone-book entry
Call RasValidateEntryName to verify the new name.
Call the RasRenameEntry function to change the name.
The return value is zero if successful, and a RAS error value is returned if it is not successful.
Changing a Phone-Book Entry Example
The following code example shows how to change an existing phone-book entry.
BOOL RenameRasEntry (LPTSTR lpszOldName, LPTSTR lpszNewName)
{
DWORD dwError; // Return code from functions
TCHAR szError[120]; // Buffer for error message
if (dwError = RasValidateEntryName (NULL, lpszNewName))
{
wsprintf (szError, TEXT("Entry name validation failed: %ld"),
dwError);
return FALSE;
}
if (dwError = RasRenameEntry (NULL, lpszOldName, lpszNewName))
{
wsprintf (szError, TEXT("Unable to rename entry: %ld"), dwError);
return FALSE;
}
return TRUE;
}
See Also
Send Feedback on this topic to the authors