Solved

Can i know whether net connection is there without using CInternetConnection?

Posted on 2000-03-18
15
240 Views
Last Modified: 2013-11-20
Hi !

    I want to know whether network connection exists without using CInternetConnection.If i try to connect using CInternetConnection,it is taking hell lot of time....

any suggestions.....
0
Comment
Question by:ceena
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
15 Comments
 
LVL 5

Accepted Solution

by:
Wyn earned 100 total points
ID: 2631155
Try InternetGetConnectedState().
Btw:You'd include wininet.h and wininet.lib

Regards

0
 

Author Comment

by:ceena
ID: 2635301
Thanks.but i have a problem .

i am using vc++ 5.0

i included wininet.h header...

but it says

   error C2065: 'InternetGetConnectedState' : undeclared identifier


how will i include wininet.lib, shd i import it.if so how?


Thanks once again.
0
 

Author Comment

by:ceena
ID: 2643291
Wyn,

   can u just suggest a solution for the above mentioned problem.


thanks in advance.
ceena
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ceena
ID: 2643303
Wyn,

   can u just suggest a solution for the above mentioned problem.


thanks in advance.
ceena
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2643825
sorry ,ceena!!!!
The email arrive very later...
You'd open the Project menu and choose the Setting sub-menu.Then choose LINK at top  and add the wininet.lib to the object/library module edit box...

Free to ask

Regards
W.Yinan
0
 

Author Comment

by:ceena
ID: 2643950
Thanks a lot.

But even if the local m/c doesnot have internet connection then also it is returning true...How is that????

  Again how will i get the true ststus of connection...like

INTERNET_CONNECTION_CONFIGURED


etc....


i mean how will u manipulate lpdwFlags...


thanks.
ceena.

0
 

Author Comment

by:ceena
ID: 2644170
Thanks a lot.

But even if the local m/c doesnot have internet connection then also it is returning true...How is that????

  Again how will i get the true ststus of connection...like

INTERNET_CONNECTION_CONFIGURED


etc....


i mean how will u manipulate lpdwFlags...


thanks.
ceena.

0
 
LVL 5

Expert Comment

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

Free to ask .

Regards
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2645603
FYI:
DWORD dwCheck = INTERNET_CONNECTION_MODEM;

BOOL check = InternetGetConnectedState(&dwCheck, 0) ;

Regards
W.Yinan
0
 

Author Comment

by:ceena
ID: 2647926
Adjusted points from 50 to 100
0
 

Author Comment

by:ceena
ID: 2647927
Thanks a lot

the support link is good.

I think i shd use IsDestinationReachable() to serve my purpose....

ceena.
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2647963
Thank you for the pts...

You are welcome.

Regards
W.Yinan
0
 

Author Comment

by:ceena
ID: 2647974
Thanks a lot

the support link is good.

I think i shd use IsDestinationReachable() to serve my purpose....

ceena.
0
 

Author Comment

by:ceena
ID: 2648213
can u just tell which header to include for IsDestinationReachable()??


0
 
LVL 5

Expert Comment

by:Wyn
ID: 2649059
Sorry ,I try to search it in MSDN disc but cannot find.I will back if I get something info ...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

734 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