Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to force a dial-up connection to start-- Wininet.DLL?
Message
From
29/03/2000 12:18:32
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
How to force a dial-up connection to start-- Wininet.DLL?
Miscellaneous
Thread ID:
00352192
Message ID:
00352192
Views:
70
Hi,

in my application I want to check if there is an open Internet connection and if there is not - force the connect with the default dial-up connection.

I tried this:
DECLARE INTEGER InternetGetConnectedState IN Wininet.dll STRING@, INTEGER
res = PADR('', 4, CHR(0))
? InternetGetConnectedState(@res,0)

The return value is 1(which is guess TRUE) so there is an open Internet conection, but then I disconnected and running the same function I got the same result???!!! In the res dword I got back 18(which I don't know what it is - the spec is talking about values 1,2,4,8)

After this confusing result I tried:
DECLARE INTEGER InternetAutodial IN Wininet.dll INTEGER,INTEGER
? InternetAutodial(1,0)
** 1 stands for: "Forces an online Internet connection"

with no Internet connections this functions returns 0
With Internet connection returns 1.
But I expected to pop up the default dial-up connection.

What else can I use?

I tried this function:
DECLARE INTEGER RasEnumEntries ;
IN rasapi32.dll ;
STRING reserved,;
STRING phonebook,;
STRING @rasentry,;
INTEGER @lnSize,;
INTEGER @lnEntries

lcBuffer = PADL('', 20*(4+257), CHR(0))
lnlen = len(lcbuffer)
ln2=0
? RasEnumEntries(chr(0), "",@lcBuffer,@lnlen,@ln2)

I got back an error message saying :
ERROR_BUFFER_INVALID

Any suggestions?

Thanks,
Vali
Next
Reply
Map
View

Click here to load this message in the networking platform