Platform SDK: RAS/Routing and RAS

RasEntryDlg

The RasEntryDlg function displays modal property sheets that allow a user to manipulate phone-book entries. If editing or copying an existing phone-book entry, the function displays a phone-book entry property sheet. The RasEntryDlg function returns when the user closes the property sheet.

BOOL RasEntryDlg(
  LPTSTR lpszPhonebook, // pointer to the full path and
                        //  file name of the phone-book file
  LPTSTR lpszEntry,     // pointer to the name of the phone-book
                        //  entry to edit, copy, or create
  LPRASENTRYDLG lpInfo  // pointer to a structure that
                        //  contains additional parameters
);

Parameters

lpszPhonebook
Pointer to a null-terminated string that specifies the full path and file name of a phone-book (PBK) file. If this parameter is NULL, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box.
lpszEntry
Pointer to a null-terminated string that contains the name of the phone-book entry to edit, copy, or create.

If you are editing or copying an entry, this parameter is the name of an existing phone-book entry. If you are copying an entry, set the RASEDFLAG_CloneEntry flag in the dwFlags member of the RASENTRYDLG structure.

If you are creating an entry, this parameter is a default new entry name that the user can change. If this parameter is NULL, the function provides a default name. If you are creating an entry, set the RASEDFLAG_NewEntry flag in the dwFlags member of the RASENTRYDLG structure.

lpInfo
Pointer to a RASENTRYDLG structure that contains additional input and output parameters. On input, the dwSize member of this structure must specify sizeof(RASENTRYDLG). Use the dwFlags member to indicate whether you are creating, editing, or copying an entry. If an error occurs, the dwError member returns an error code; otherwise, it returns zero.

Return Values

If the user creates, copies, or edits a phone-book entry, the return value is a nonzero value.

If an error occurs, or if the user cancels the operation, the return value is zero. If an error occurs, the dwError member of the RASENTRYDLG structure returns a nonzero system error code or RAS error code.

Remarks

The RasCreatePhonebookEntry and RasEditPhonebookEntry functions call the RasEntryDlg function.

The following sample code brings up a property sheet to create a new entry. The lpEntry variable specifies the default name for the new entry.

lpInfo = (LPRASENTRYDLG) GlobalAlloc(GPTR, sizeof(RASENTRYDLG));
ZeroMemory(lpInfo, sizeof(RASENTRYDLG));
lpInfo->dwSize = sizeof(RASENTRYDLG);
 
lpInfo->dwFlags |= RASEDFLAG_NewEntry;
nRet = RasEntryDlg(NULL, lpszEntry, lpInfo);
 
if (nRet)
    printf("New entry created: %s\n", lpInfo->szEntry);
else
{
    if (lpInfo->dwError != 0)
    {
        printf("RasEntryDlg failed: Error = %d\n", lpInfo->dwError);
    }
    else
        printf("User pressed Cancel\n");
}

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Unsupported.
  Header: Declared in Rasdlg.h.
  Library: Use Rasdlg.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.

See Also

Remote Access Service (RAS) Overview, Remote Access Service Functions, RasCreatePhonebookEntry, RasEditPhonebookEntry, RASENTRYDLG