Wininet API to test for internet connection 
Author Message
 Wininet API to test for internet connection

I am using the following call to the wininet API in win98:
the problem being that it does not return a 0 value when not connected, as I
believe it should.
Conn returns a positive long whether connected or not.

Any suggestions?

-------------------

  Const INTERNET_OPEN_TYPE_PRECONFIG As Long = 0
  Const szUserAgent = "Mozilla/4.73 [en] (Windows 95; U)"

        conn = InternetOpen(sAgent:=szUserAgent, _
                lAccessType:=INTERNET_OPEN_TYPE_PRECONFIG, _
                sProxyName:=vbNullString, _
                sProxyBypass:=vbNullString, _
                lFlags:=0)



Wed, 16 Jun 2004 20:00:56 GMT  
 Wininet API to test for internet connection
Hi,
I had a similar problem in a project.
The API you are using is not meant to check
for the connection state.

You're best bet is to go to this site:
http://www.mvps.org/vbnet/

Search on 'Active Connection'

I ended up using the one that determines if
you have an active dial-up.

HTH
Dan Artuso, MVP

Quote:

> I am using the following call to the wininet API in win98:
> the problem being that it does not return a 0 value when not connected, as I
> believe it should.
> Conn returns a positive long whether connected or not.

> Any suggestions?

> -------------------

>   Const INTERNET_OPEN_TYPE_PRECONFIG As Long = 0
>   Const szUserAgent = "Mozilla/4.73 [en] (Windows 95; U)"

>         conn = InternetOpen(sAgent:=szUserAgent, _
>                 lAccessType:=INTERNET_OPEN_TYPE_PRECONFIG, _
>                 sProxyName:=vbNullString, _
>                 sProxyBypass:=vbNullString, _
>                 lFlags:=0)



Thu, 17 Jun 2004 00:04:06 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Internet Connection State using wininet.dll and InternetGetConnectedStateEx

2. WinInet and Internet Connection

3. Wininet API connection through proxy - can't get by error 407 (authentication)

4. URGENT - Help, How do start the default INETNET CONNECTION using either Inet or Wininet API call

5. Initiating a dial up connection w/ Inet control or wininet API calls

6. Please Help: Win32 Internet API (wininet.dll)

7. Download files from secure Internet site (HTTPS, SSL) using WinInet API

8. Download files from secure Internet site (HTTPS, SSL) using WinInet API

9. Wininet API connection through proxy - can't get by error 407 (authentication)

10. Asynchronous Connection - WinInet API

11. WinInet API Calls for Dial Up Connection

12. https connection using WinInet API in VB5.0 freezes on exit

 

 
Powered by phpBB® Forum Software