Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WinInet troubleshooting
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00356440
Message ID:
00356446
Views:
26
>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
>
>DECLARE INTEGER InternetOpen IN WININET.DLL ;
> STRING, ;
> INTEGER, ;
> STRING, ;
> STRING, ;
> INTEGER
>
>hInternet = InternetOpen("EKraft Web Application", 0, NULL,NULL,0)
>
>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"
>
>FWIW, the C declaration for InternetQueryoption is:
>
>BOOL InternetQueryOption(
>    IN HINTERNET hInternet,
>    IN DWORD dwOption,
>    OUT LPVOID lpBuffer,
>    IN OUT LPDWORD lpdwBufferLength
>);
>
>
>Anyone see what I could be doing wrong?

Erik,

The second parameter should be an integer:
DECLARE INTEGER InternetQueryOption IN WinInet.dll;
    INTEGER hInternet,
    INTEGER dwOption,
    STRING @lpBuffer,
    INTEGER @lpdwBufferLength
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform