Network Connection

Posted on 2000-01-02
Medium Priority
Last Modified: 2013-11-20
Hi All,

How to detect the status of the network connection,

I hope my application can pop-up a dialog to notice the user when the connection has been disconnected.
Note: I want to do the same thing as the software ICQ.

Also, the network may be connected by using the dial-up networking or at the LAN.

How can I do this?

Thank you very much for your help!!!
Question by:ee_lcpaa
  • 3
  • 2
  • 2
LVL 32

Accepted Solution

jhance earned 400 total points
ID: 2318425
BOOL InternetGetConnectedState(
    OUT LPDWORD lpdwFlags,
    IN DWORD dwReserved

Declared in WININET.H and links with WININET.LIB.
LVL 23

Expert Comment

ID: 2318820
HOWTO: Detecting If You Have a Connection to the Internet

Author Comment

ID: 2319307
Dear jhance & chensu,

I am using the Visual C++ 5.0 Professional Edition to implement my application. After including the file <wininet.h> and linking with the file wininet.lib, I still cannot use the function InternetGetConnectedState.

What is the problem about this?


2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

LVL 23

Expert Comment

ID: 2319344
You need the latest Platform SDK, which can be found on MSDN CDs or can be downloaded at

LVL 32

Expert Comment

ID: 2319860
The version of VC++ is not relevant, but your header files are out of date.

Specifically, you need WININET.H and WININET.LIB out of the current SDK.  

The function InternetGetConnectedState() itself is in WININET.DLL included on any Windows system with IE4.0 or later installed.

Author Comment

ID: 2321672
Hi jhance and chensu,

My PC had already installed IE 5.0. I still cannot use the function

Furhter, I have installed the Microsoft Platform SDK (January 2000) at my PC. But I found the header file wininet.h and the lib file wininet.lib had not been changed also.

I found Only the wininet.dll had been updated.

Can you tell me how can I obtain the update version of the file wininet.h and wininet.lib?

Thank you very much!!!
LVL 23

Expert Comment

ID: 2321845
>But I found the header file wininet.h and the lib file wininet.lib had not been changed also.

You must have looked at the Visual C++ directories. The Platform SDK is installed separately. By default, it is in the \Program Files\Platform SDK directory. You need to change your Visual C++ options (menu Tools/Options..., Directories tab) so that it uses the Platform SDK header files and library files.

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
Suggested Courses
Course of the Month5 days, 20 hours left to enroll

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question