Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

internet connection alive? 1

Status
Not open for further replies.

bobo12

Programmer
Dec 26, 2004
74
US
how do i check if internet connection is alive on xp,2000,98? are they the same funcs or different?
 
Use winsock and try to connect to some web page, like Google, and see if it fails or not.
 
yes this works, but i was thinking of something rather more behind the scenes, so the user won't actually see a browser trying to open google.com. any other advice,
 
hi, here is my short code to basically check for internet connection but i keep getting these 3 unresovled external symbols errors listed below...

my code...
HINTERNET hINet, hConnection, hData;
CHAR buffer[2048] ;

DWORD dwRead, dwFlags, dwStatus ;

hINet = InternetOpen("InetURL/1.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );

if ( !hINet )
{
;
}


hConnection = InternetConnect( hINet, " 80, " "," ", INTERNET_SERVICE_HTTP, 0, 0 );


if ( !hConnection )
{
InternetCloseHandle(hINet);
return TRUE;
}

ERRORS:
adware error LNK2019: unresolved external symbol __imp__InternetCloseHandle@4 referenced in function _WinMain@16

adware error LNK2019: unresolved external symbol __imp__InternetConnectA@32 referenced in function _WinMain@16

adware error LNK2019: unresolved external symbol __imp__InternetOpenA@20 referenced in function _WinMain@16

does anyone know how i can fix this?
thanks a lot
 
All these WinInet functions are placed in wininet.lib import library. Is it added to your project?
 
yes i already have #include <wininet.h> in my code but the problem still persists?
 
It's not a header file problem because of you have linker errors. Add library to your project (see IDE help).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top