Message
From
06/04/2000 17:01:38
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00356440
Message ID:
00356537
Views:
31
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
);
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?
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View