Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Downloading a file - timeout
Message
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00571714
Message ID:
00572749
Views:
34
>I setup part of an application to pull daily updates from a file stored on a website.
>
>Of all of the clients, two fail:
> ISDN Windows NT 4.0 SBS setup using Proxy
> Cable modem Windows 2000 SBS setup using Proxy
>
>All but these two the application used MSDN KB article mskb#Q174524.
>
>I was not able to figure out how to get the last error message. The code was able to run InternetOpen but failed on InternetOpenUrl.

You have to use GetLastError function to get API Error number
Declare Integer GetLastError In kernel32.dll as GetLastError

Declare Integer FormatMessage In kernel32.dll as FormatMessage ;
		Integer dwFlags, ;
		String @lpSource, ;
		Integer dwMessageId, ;
		Integer dwLanguageId, ;
		String @lpBuffer, ;
		Integer nSize, ;
		Integer Arguments

lcErrorTxt = ApiError()	
? lcErrorTxt 

.....
FUNCTION ApiError

Local lcErrBuffer, lcErrorMess, liNewErr, lnErrorCode
lcErrBuffer = REPL(CHR(0),1000)
lnErrorCode = GetLastError()
liNewErr = FormatMessage(0x1000;
 	,.NULL., lnErrorCode, 0, @lcErrBuffer,500,0)

lcErrorMess = Transform(lnErrorCode) + "    " + LEFT(lcErrBuffer, AT(CHR(0),lcErrBuffer)- 1 )

RETURN lcErrorMess
< snip >
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform