?
Solved

Network Connection

Posted on 2000-01-02
7
Medium Priority
?
189 Views
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!!!
0
Comment
Question by:ee_lcpaa
  • 3
  • 2
  • 2
7 Comments
 
LVL 32

Accepted Solution

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

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

Expert Comment

by:chensu
ID: 2318820
HOWTO: Detecting If You Have a Connection to the Internet
http://support.microsoft.com/support/kb/articles/Q242/5/58.ASP
0
 

Author Comment

by:ee_lcpaa
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?

regards,

ee_lcpaa
0
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

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

http://msdn.microsoft.com/developer/sdk/platform.asp
0
 
LVL 32

Expert Comment

by:jhance
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.
0
 

Author Comment

by:ee_lcpaa
ID: 2321672
Hi jhance and chensu,

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

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!!!
0
 
LVL 23

Expert Comment

by:chensu
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.
0

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