Click to return to the Networking, Protocols     
InternetAutodialHangup Fu...     InternetGetConnectedState...     Automatic Dialing Functio...    
Web Workshop  |  Networking, Protocols & Data Formats

InternetDial Function


Initiates a connection to the Internet using a modem.

Syntax

DWORD InternetDial(
    IN HWND hwndParent,
    IN LPTSTR lpszConnectoid,
    IN DWORD dwFlags,
    OUT LPDWORD lpdwConnection,
    IN DWORD dwReserved
);

The actual syntax of this function varies between its ANSI and Unicode implementations. For more information, see Win32 Internet Functions Syntax.

Parameters

hwndParent
Handle to the parent window.
lpszConnectoid
Address of a string variable containing the name of the dial-up connection to use.
dwFlags
Unsigned long integer value that contains the flags to use. This can be one of the following values:
INTERNET_AUTODIAL_FORCE_ONLINE
Forces an online connection.
INTERNET_AUTODIAL_FORCE_UNATTENDED
Forces an unattended Internet dial-up. If user intervention is required, the function will fail.
INTERNET_DIAL_FORCE_PROMPT
Ignores the "dial automatically" setting and forces the dialing user interface to be displayed.
INTERNET_DIAL_UNATTENDED
Connects to the Internet through a modem, without displaying a user interface, if possible. Otherwise, the function will wait for user input.
INTERNET_DIAL_SHOW_OFFLINE
Shows the Work Offline button instead of Cancel button in the dialing user interface.
lpdwConnection
Address of an unsigned long integer value containing the number associated to the connection.
dwReserved
Reserved. Must be set to zero.

Return Value

Returns ERROR_SUCCESS if successful, or an error code otherwise. The error code can be one of the following:

ERROR_INVALID_PARAMETER One or more of the parameters are incorrect.
ERROR_NO_CONNECTION There is a problem with the dial-up connection.
ERROR_USER_DISCONNECTION The user clicked either the Work Offline or Cancel button on the Internet connection dialog box.

Function Information

Windows NT Use version 4.0. Implemented as ANSI and Unicode functions.
Windows Use Windows 95 and later. Implemented as ANSI and Unicode functions.
Header Wininet.h
Import library Wininet.lib
Minimum availability Internet Explorer 4.0 (ANSI only), 5 (ANSI and Unicode)

See Also

Microsoft Win32 Internet Functions Overview, Establishing a Dial-Up Connection to the Internet, Microsoft Win32 Internet Functions Reference, Automatic Dialing Functions



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.