Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WinInet troubleshooting
Message
From
07/04/2000 06:42:58
 
 
To
06/04/2000 17:01:38
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00356440
Message ID:
00356717
Views:
22
>Ok, now the problem that first appeared with InternetQueryOption and disappeared seemingly without cause, will not disappear with InternetSetOption.
>
>Here's the code I am using:
>
>DECLARE INTEGER GetLastError IN Win32API
>
>DECLARE INTEGER InternetSetOption IN WinInet.dll ;
>	LONG hInternet, ;
>	INTEGER dwOption, ;
>	STRING @lpBuffer, ;
>	LONG lpdwBufferLength
>
>DECLARE INTEGER InternetOpen IN WinInet.DLL ;
>	STRING, ;
>	INTEGER, ;
>	STRING, ;
>	STRING, ;
>	INTEGER
>
>INTERNET_OPTION_PROXY_USERNAME = 43
>INTERNET_OPTION_PROXY_PASSWORD = 44
>INTERNET_OPTION_USER_AGENT = 40
>
>hInternet = InternetOpen("EKraft Web Application", 0, NULL, NULL, 0)
>lpBuffer = "esmoore"
>lpdwBufferLength = LEN(lpBuffer)
>?InternetSetoption(hInternet, INTERNET_OPTION_PROXY_USERNAME, @lpBuffer, lpdwBufferLength)
>
>and here is the C function declaration:
>
>BOOL InternetSetOption(
>    IN HINTERNET hInternet,
>    IN DWORD dwOption,
>    IN LPVOID lpBuffer,
>    IN DWORD dwBufferLength
>);
>
>

Eric, see my reply to the previous question; try allocating a static block and passing the pointer to the block by reference - structures don't like to be moved about.

>The error returned is 12018: "The supplied handle is the wrong type for the requested operation". The handle being returned by InternetOpen, and passed to InternetSetOption consistently looks like: 13369352. Declaring the hInternet parameter as LONG or INTEGER makes no difference.
>
>Anybody see the problem?
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform