Skip to main content

[Migrated content. Thread originally posted on 12 December 2004]

I am trying to get the InternetDial function in the WinInet.dll to work but I am having problems. I am using this to establish a dialup connection to a remote network automatically. Any other suggestions on how to establish a remote connection would be appreciated.

Attached is the program used. Below is the function reference

Function from the Windows SDK.
Initiates a connection to the Internet using a modem.

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


Any help would be greatly appreciated.

Thanks Jason

[Migrated content. Thread originally posted on 12 December 2004]

I am trying to get the InternetDial function in the WinInet.dll to work but I am having problems. I am using this to establish a dialup connection to a remote network automatically. Any other suggestions on how to establish a remote connection would be appreciated.

Attached is the program used. Below is the function reference

Function from the Windows SDK.
Initiates a connection to the Internet using a modem.

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


Any help would be greatly appreciated.

Thanks Jason
Did you forget the attachment?

[Migrated content. Thread originally posted on 12 December 2004]

I am trying to get the InternetDial function in the WinInet.dll to work but I am having problems. I am using this to establish a dialup connection to a remote network automatically. Any other suggestions on how to establish a remote connection would be appreciated.

Attached is the program used. Below is the function reference

Function from the Windows SDK.
Initiates a connection to the Internet using a modem.

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


Any help would be greatly appreciated.

Thanks Jason
Did you forget the attachment?

[Migrated content. Thread originally posted on 12 December 2004]

I am trying to get the InternetDial function in the WinInet.dll to work but I am having problems. I am using this to establish a dialup connection to a remote network automatically. Any other suggestions on how to establish a remote connection would be appreciated.

Attached is the program used. Below is the function reference

Function from the Windows SDK.
Initiates a connection to the Internet using a modem.

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


Any help would be greatly appreciated.

Thanks Jason
Did you forget the attachment?

[Migrated content. Thread originally posted on 12 December 2004]

I am trying to get the InternetDial function in the WinInet.dll to work but I am having problems. I am using this to establish a dialup connection to a remote network automatically. Any other suggestions on how to establish a remote connection would be appreciated.

Attached is the program used. Below is the function reference

Function from the Windows SDK.
Initiates a connection to the Internet using a modem.

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


Any help would be greatly appreciated.

Thanks Jason
Sorry about that...here's the code.

[Migrated content. Thread originally posted on 12 December 2004]

I am trying to get the InternetDial function in the WinInet.dll to work but I am having problems. I am using this to establish a dialup connection to a remote network automatically. Any other suggestions on how to establish a remote connection would be appreciated.

Attached is the program used. Below is the function reference

Function from the Windows SDK.
Initiates a connection to the Internet using a modem.

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


Any help would be greatly appreciated.

Thanks Jason
Originally posted by Jhoward
I am trying to get the InternetDial function in the WinInet.dll to work

This below, should be okay. But remember to set lpConnectoid to the title of an existing internet connectio on your machine.
You will find these under the network folder in the control panel.


*
IDENTIFICATION DIVISION.
PROGRAM-ID. TEMPLATE.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
WORKING-STORAGE SECTION.

77 CNTL-FONT USAGE HANDLE OF FONT SMALL-FONT.
77 KEY-STATUS IS SPECIAL-NAMES
CRT STATUS PIC 9(4) VALUE 0.
88 UNKNOWN VALUE 0.
88 EXIT-PRESSED VALUE 27.


77 CobWinHandle HANDLE OF WINDOW.
77 hwndParent PIC X(4) COMP-N.
77 lpszConnectoid PIC X(128).
77 dwFlags PIC X(4) COMP-N.
77 lpdwConnection PIC X(4) COMP-N.
77 dwReserved PIC X(4) COMP-N.
77 i32Err PIC S9(9) COMP-5.

SCREEN SECTION.
01 TEMPLATE-SCREEN.

03 PUSH-BUTTON
LINE 13
COL 63
SIZE 14
TITLE "E&xit"
SELF-ACT
EXCEPTION-VALUE = 27.


PROCEDURE DIVISION.
MAIN-LOGIC.

INITIALIZE KEY-STATUS.

DISPLAY STANDARD GRAPHICAL WINDOW
TITLE "InternetDial"
CONTROL FONT CNTL-FONT
SIZE 80
LINES 15
HANDLE CobWinHandle
BACKGROUND-LOW.

INQUIRE CobWinHandle SYSTEM HANDLE IN hwndParent.
DISPLAY TEMPLATE-SCREEN.
PERFORM GET-CONNECTION.
PERFORM WITH TEST AFTER UNTIL EXIT-PRESSED
ACCEPT TEMPLATE-SCREEN
END-PERFORM.
DESTROY TEMPLATE-SCREEN.
GOBACK.

GET-CONNECTION.
SET ENVIRONMENT "DLL-CONVENTION" TO "1".
CALL "C:\\WINDOWS\\SYSTEM32\\WININET.DLL"
ON EXCEPTION
DISPLAY MESSAGE
"Error loading Wininet.dll"
.

STRING "your connection goes here" | Must match an existing dial up
LOW-VALUES DELIMITED BY SIZE
INTO lpszConnectoid.
CALL "InternetdialA" USING
BY VALUE hwndParent
BY REFERENCE lpszConnectoid
BY VALUE 8
BY REFERENCE lpdwConnection
BY VALUE 0
GIVING i32Err
ON EXCEPTION
display message "failed dial".

CALL "InternetGetConnectedState" USING
BY REFERENCE dwFlags
BY VALUE 0
GIVING i32Err
ON EXCEPTION
display Message "Failed".


EXIT PARAGRAPH.
[\\CODE]

[Migrated content. Thread originally posted on 12 December 2004]

I am trying to get the InternetDial function in the WinInet.dll to work but I am having problems. I am using this to establish a dialup connection to a remote network automatically. Any other suggestions on how to establish a remote connection would be appreciated.

Attached is the program used. Below is the function reference

Function from the Windows SDK.
Initiates a connection to the Internet using a modem.

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


Any help would be greatly appreciated.

Thanks Jason
Jhoward,
Be careful about using a fixed path in your CALL statement, like "C:\\WINDOWS\\SYSTEM32\\WININET.DLL". This might not translate well to other(older) flavors of windows, or for non-standard windows installs. With 6.2 runtime you should be able to just call "WININET.DLL" and the default windows and system folders will be referenced. For runtime prior to 6.2, you should place a "." in your runtimes CODE-PREFIX environment variable.

[Migrated content. Thread originally posted on 12 December 2004]

I am trying to get the InternetDial function in the WinInet.dll to work but I am having problems. I am using this to establish a dialup connection to a remote network automatically. Any other suggestions on how to establish a remote connection would be appreciated.

Attached is the program used. Below is the function reference

Function from the Windows SDK.
Initiates a connection to the Internet using a modem.

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


Any help would be greatly appreciated.

Thanks Jason
Jhoward,
Be careful about using a fixed path in your CALL statement, like "C:\\WINDOWS\\SYSTEM32\\WININET.DLL". This might not translate well to other(older) flavors of windows, or for non-standard windows installs. With 6.2 runtime you should be able to just call "WININET.DLL" and the default windows and system folders will be referenced. For runtime prior to 6.2, you should place a "." in your runtimes CODE-PREFIX environment variable.

[Migrated content. Thread originally posted on 12 December 2004]

I am trying to get the InternetDial function in the WinInet.dll to work but I am having problems. I am using this to establish a dialup connection to a remote network automatically. Any other suggestions on how to establish a remote connection would be appreciated.

Attached is the program used. Below is the function reference

Function from the Windows SDK.
Initiates a connection to the Internet using a modem.

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


Any help would be greatly appreciated.

Thanks Jason
Jhoward,
Be careful about using a fixed path in your CALL statement, like "C:\\WINDOWS\\SYSTEM32\\WININET.DLL". This might not translate well to other(older) flavors of windows, or for non-standard windows installs. With 6.2 runtime you should be able to just call "WININET.DLL" and the default windows and system folders will be referenced. For runtime prior to 6.2, you should place a "." in your runtimes CODE-PREFIX environment variable.

[Migrated content. Thread originally posted on 12 December 2004]

I am trying to get the InternetDial function in the WinInet.dll to work but I am having problems. I am using this to establish a dialup connection to a remote network automatically. Any other suggestions on how to establish a remote connection would be appreciated.

Attached is the program used. Below is the function reference

Function from the Windows SDK.
Initiates a connection to the Internet using a modem.

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


Any help would be greatly appreciated.

Thanks Jason
Thanks for the information...worked like a charm..