Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with WININET.DLL in XP
Message
 
To
31/01/2003 16:53:52
Joel Whitehead
Ccs Central Computer Services Inc.
Thunder Bay, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00747884
Message ID:
00748017
Views:
19
Try this code:

#DEFINE INTERNET_AUTODIAL_FORCE_ONLINE 1
#DEFINE INTERNET_AUTODIAL_FORCE_UNATTENDED 2

DECLARE INTEGER GetActiveWindow IN user32

DECLARE INTEGER InternetAutodial IN wininet.dll;
INTEGER dwFlags, INTEGER dwReserved

DECLARE INTEGER InternetAutodialHangup IN wininet.dll;
INTEGER dwReserved

* To prompt the user to connect to the Net
*= InternetAutodial (INTERNET_AUTODIAL_FORCE_ONLINE, 0)

* To automatically start dialling
*? InternetAutodial(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0)
? InternetAutodial(INTERNET_AUTODIAL_FORCE_UNATTENDED, GetActiveWindow())

* To disconnect an automatically dialled connection
*= InternetAutodialHangup(0)

* * *
What is returned?
The InternetAutodial function requires IE 4.0 or later.

MSDN does not specify how to process an error state. Though I think you could try the InternetGetLastResponseInfo function:

DECLARE SHORT InternetGetLastResponseInfo IN wininet;
INTEGER @ lpdwError,;
STRING @ lpszBuffer,;
INTEGER @ lpdwBufferLength

Run this code after an unsuccessfull call:

LOCAL nError, cBuffer, nBufsize
nError = 0
nBufsize = 250
cBuffer = Repli(Chr(0), nBufsize)
? InternetGetLastResponseInfo(@nError, @cBuffer, @nBufsize)
? SUBSTR(cBuffer, 1, nBufsize)

* * *
Check the following links:
http://www.vb-world.net/tips/tip478.html

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/establishing_a_dial_up_connection_to_the_internet.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/internetautodial.asp

* * *
More WININET API calls at http://www.news2news.com/vfp?group=92
Previous
Reply
Map
View

Click here to load this message in the networking platform