Network Connection

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!!!
ee_lcpaaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jhanceCommented:
BOOL InternetGetConnectedState(
    OUT LPDWORD lpdwFlags,
    IN DWORD dwReserved
);

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chensuCommented:
HOWTO: Detecting If You Have a Connection to the Internet
http://support.microsoft.com/support/kb/articles/Q242/5/58.ASP
0
ee_lcpaaAuthor Commented:
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
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

chensuCommented:
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
jhanceCommented:
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
ee_lcpaaAuthor Commented:
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
chensuCommented:
>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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.