General information
Category:
Windows API functions
Hi Erik --
>>>
Having trouble getting a WinInet function to work, and wondered if anyone can see what I am doing wrong:
DECLARE INTEGER InternetQueryOption IN WinInet.dll ;
INTEGER hInternet, ;
STRING dwOption, ;
STRING @lpBuffer, ;
LONG @lpdwBufferLength
<<<
First off, if VFP differentiates between an INTEGER and a LONG (presumably 2 and 4 bytes, respectively?), the hInternet parameter should be a LONG. Under 9x, this change may have no practical result, but in NT failing to use the full 32bits of a handle will nearly always cause problems.
>>>
DECLARE INTEGER InternetOpen IN WININET.DLL ;
STRING, ;
INTEGER, ;
STRING, ;
STRING, ;
INTEGER
<<<
Ditto here.
>>>
hInternet = InternetOpen("EKraft Web Application", 0, NULL,NULL,0)
<<<
What's this call returning?
>>>
lpdwBufferLength = 0
lpBuffer = SPACE(0)
dwOption = NumToDWord(41)
?InternetQueryOption(hInternet, dwOption, @lpBuffer, @lpdwBufferLength)
41 is the value for a valid option as defined Wininet.h, and NumToDWord is a VFP function that does what its name implies. The call returns 0 (failed), and GetLastError returns the code for "Parameter is Incorrect"
<<<
(41 equates to INTERNET_OPTION_USER_AGENT, right?)
I immediately felt the zero-length buffer would be a problem, but in this case that should be okay, with the last parameter returning the correct length and a lasterror of "insufficient buffer."
I'm leaning, at the moment, towards the (presumably) 16-bit handle you're passing that's causing the incorrect parameter error. Make sense?
Later... Karl
.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only