RasCreatePhonebookEntryA function (ras.h)

[This function has been deprecated as of Windows Vista and its functionality has been replaced by RasDialDlg. ]

The RasCreatePhonebookEntry function creates a new phone-book entry. The function displays a dialog box in which the user types information for the phone-book entry.

Syntax

DWORD RasCreatePhonebookEntryA(
  [in] HWND   unnamedParam1,
  [in] LPCSTR unnamedParam2
);

Parameters

[in] unnamedParam1

Handle to the parent window of the dialog box.

[in] unnamedParam2

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.

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is one of the following error codes or a value from Routing and Remote Access Error Codes or Winerror.h.

Return code Description
ERROR_CANNOT_OPEN_PHONEBOOK
The phone book is corrupted or missing components.

Remarks

When calling RasDialDlg, set each member of the RASDIALDLG structure passed to lpInfo to zero except:

  • dwSize = sizeof(RASDIALDLG)
  • hwndOwner = the hwnd parameter above
  • dwFlags = RASEDFLAG_NewEntry

Note

The ras.h header defines RasCreatePhonebookEntry as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ras.h
Library Rasapi32.lib
DLL Rasapi32.dll

See also

RasEditPhonebookEntry

RasEntryDlg

RasGetEntryDialParams

RasSetEntryDialParams

Remote Access Service (RAS) Overview

Remote Access Service Functions