InternetGetConnectedStateEx returning incorrect information


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: InternetGetConnectedStateEx returning incorrect information

  1. #1
    DavidR Guest

    InternetGetConnectedStateEx returning incorrect information


    Using the WinInet library to determine whether or not the user has an active
    connection to the internet and how they connect. When I use InternetGetConnectedStateEx
    however it basically lies to me. Tested on a machine with no connection established
    whatsoever. The function returned back and told me that not only was I connected
    but I was connected over a LAN..the machine is a stand-alone, has no connection
    to the network.

    Has anyone found a reliable way to determine if an internet connection exists
    and if not to establish one. Or is my only option to use this poorly documented
    library that just doesn't seem to work properly.

  2. #2
    Karl E. Peterson Guest

    Re: InternetGetConnectedStateEx returning incorrect information

    Hi David --

    > Using the WinInet library to determine whether or not the user has an active
    > connection to the internet and how they connect. When I use

    InternetGetConnectedStateEx
    > however it basically lies to me. Tested on a machine with no connection established
    > whatsoever. The function returned back and told me that not only was I connected
    > but I was connected over a LAN..the machine is a stand-alone, has no connection
    > to the network.
    >
    > Has anyone found a reliable way to determine if an internet connection exists
    > and if not to establish one. Or is my only option to use this poorly documented
    > library that just doesn't seem to work properly.


    Yeah, basically wininet just tells you what the registry tells it. The only way to
    really know is to look for something you're relatively sure should be there. See the
    NetConnect.zip sample at http://www.mvps.org/vb for my hack.

    Later... Karl
    --
    [Microsoft Basic: 1976-2001, RIP]


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center