RasDialDlg function establishes a RAS connection using a specified phone-book entry and the credentials of the logged-on user. The function displays a stream of dialog boxes that indicate the state of the connection operation.
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.
Pointer to a null-terminated string that specifies the name of the phone-book entry to dial.
Pointer to a null-terminated string that specifies a phone number that overrides the numbers stored in the phone-book entry. If this parameter is NULL,
RasDialDlg uses the numbers in the phone-book entry.
Pointer to a
RASDIALDLG structure that specifies additional input and output parameters. The dwSize member of this structure must specify sizeof(RASDIALDLG). If an error occurs, the dwError member returns an error code; otherwise, it returns zero.
If the function establishes a RAS connection, the return value is TRUE. Otherwise, the function should return FALSE.
RasDialDlg function displays a series of dialog boxes that are similar to the dialog boxes the main Dial-Up Networking dialog box displays when the user selects the Dial button. Use the
RasDialDlg function to display a standard user interface for a connection operation without presenting the main phone-book dialog box. For example, the RAS AutoDial service uses this function to establish a connection using the phone-book entry associated with a remote address.
RasDialDlg function displays dialog boxes during the connection operation to provide feedback to the user about the progress of the operation. For example, the dialog boxes might indicate when the operation is dialing, when it is authenticating the user's credentials on the remote server, and so on. The dialog boxes also provide a Cancel button for the user to terminate the operation.
RasDialDlg returns when the connection is established, or when the user cancels the operation.
The following sample code dials the entry in the default phone-book specified by the variable lpszEntry.
Note This simple sample is intended to run on Windows Vista and later versions of Windows. Please be aware the call to sizeof(RASENTRY) will return a different value depending on what version of the operating system the code is being run. Please take steps to ensure this is handled appropriately.