codefinger
Programmer
Declare Function InternetConnect _
Lib "wininet.dll" Alias "InternetConnectA" ( _
ByVal hInternetSession As Long, _
ByVal sServerName As String, _
ByVal nServerPort As Integer, ByVal sUsername As String, _
ByVal sPassword As String, ByVal lService As Long, _
ByVal lFlags As Long, ByVal lContext As Long) As Long
Code:
Public Function OpenConnection() As String
hConnection = InternetConnect(hOpen, Ppn_connectto, _
INTERNET_INVALID_PORT_NUMBER, _
"", "", INTERNET_SERVICE_HTTP, 0, 0)
If hConnection = 0 Then
OpenConnection = "Could not connect to server " &ppn_connectto & ":
" & Err.Description
Exit Function
End If
OpenConnection = "Connection successful!"
End Function
Always returns "Connection successful!", even when cable modem is unplugged!
Any and all assistance greatly appreciated. Thanks in advance.