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

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.....
ceenaAsked:
Who is Participating?
 
WynConnect With a Mentor Commented:
Try InternetGetConnectedState().
Btw:You'd include wininet.h and wininet.lib

Regards

0
 
ceenaAuthor Commented:
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
 
ceenaAuthor Commented:
Wyn,

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


thanks in advance.
ceena
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
ceenaAuthor Commented:
Wyn,

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


thanks in advance.
ceena
0
 
WynCommented:
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
 
ceenaAuthor Commented:
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
 
ceenaAuthor Commented:
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
 
WynCommented:
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
 
WynCommented:
FYI:
DWORD dwCheck = INTERNET_CONNECTION_MODEM;

BOOL check = InternetGetConnectedState(&dwCheck, 0) ;

Regards
W.Yinan
0
 
ceenaAuthor Commented:
Adjusted points from 50 to 100
0
 
ceenaAuthor Commented:
Thanks a lot

the support link is good.

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

ceena.
0
 
WynCommented:
Thank you for the pts...

You are welcome.

Regards
W.Yinan
0
 
ceenaAuthor Commented:
Thanks a lot

the support link is good.

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

ceena.
0
 
ceenaAuthor Commented:
can u just tell which header to include for IsDestinationReachable()??


0
 
WynCommented:
Sorry ,I try to search it in MSDN disc but cannot find.I will back if I get something info ...
0
All Courses

From novice to tech pro — start learning today.