Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WININET.DLL Function Problem
Message
De
30/09/1998 19:07:05
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
WININET.DLL Function Problem
Divers
Thread ID:
00142611
Message ID:
00142611
Vues:
52
Hi All!

I am developing an application for release in early November (so time is critical). I am attampting to use the "InternetCheckConnection" function within WININET.DLL to detect the presence of an active Internet connection. Using the code below, I can never get a positive indication, even when IE is online and connected to the specified URL.
I am working in VFP 6.0, and any help would be much appreciated, especially if there is another way to positively detect an Internet connection without recourse to WinSock (this is needed to differentiate between a modem connection and a LAN connection).

Thanks

Terry Bridges

****************************************************************
PROCEDURE CHECKCON

LOCAL lnreturn, lcURL, lnflags, lnreserved

lnreturn = 2
lcURL = "http://www.ndss.com"
lnflags = 1
lnreserved = 0

DECLARE Integer InternetCheckConnection in WININET as InternetCheckConnection String @, Integer,
Integer

lnreturn = InternetCheckConnection(@lcURL,lnflags,lnreserved)

DO CASE

CASE lnreturn = 1

MessageBox ('Connection was Successful')

CASE lnreturn = 0

MessageBox ('No Connection Detected')

OTHERWISE

MessageBox ('Connection Error: '+ LTRIM(STR(lnreturn)))

ENDCASE

RETURN lnreturn
**************************************************************
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform