Solved

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

Posted on 2000-03-18
15
231 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
  • 9
  • 6
15 Comments
 
LVL 5

Accepted Solution

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

Regards

0
 

Author Comment

by:ceena
Comment Utility
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
Comment Utility
Wyn,

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


thanks in advance.
ceena
0
 

Author Comment

by:ceena
Comment Utility
Wyn,

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


thanks in advance.
ceena
0
 
LVL 5

Expert Comment

by:Wyn
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 5

Expert Comment

by:Wyn
Comment Utility
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
Comment Utility
FYI:
DWORD dwCheck = INTERNET_CONNECTION_MODEM;

BOOL check = InternetGetConnectedState(&dwCheck, 0) ;

Regards
W.Yinan
0
 

Author Comment

by:ceena
Comment Utility
Adjusted points from 50 to 100
0
 

Author Comment

by:ceena
Comment Utility
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
Comment Utility
Thank you for the pts...

You are welcome.

Regards
W.Yinan
0
 

Author Comment

by:ceena
Comment Utility
Thanks a lot

the support link is good.

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

ceena.
0
 

Author Comment

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


0
 
LVL 5

Expert Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now