Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WinInet troubleshooting
Message
 
To
06/04/2000 15:37:55
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00356440
Message ID:
00356568
Views:
25
Hi Erik --

>>>
>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.

VFP does differentiate.
<<<

Weird. Now, George just told me the "difference" was rather, well, silly. Are you aware of a definition other than the one he posted?

>>>
And I was having problems with this. The error being returned was "The handle passed is the wrong type", or something to that effect. So I ws confident that changing the declaration to use a LONG instead of an integer would change things, and it didn't. I have a bunch of other WinInet wrappers written, and I went back and doublecheked them, and they too are using INTEGER for hInternet, with no problems.
<<<

Bizarre. There are *so* many potential handles flying around in wininet, it is easy to pass the wrong one to a function, but it sure looked like you were using the right one here.

>>>
I'm not sure what happened, but it works now. I crashed VFP a couple of times, and the last time when I reentered and ran the code, it worked. Beats me.
<<<

Gotta love it, eh? <g>

>>>
I am actually working on a function that can set the proxy username and password for proxy servers that require a login with each connection.
<<<

Sounds like a fun one!

>>>
>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."

Yeah, I ran it first with a zero length buffer, and it returned that the buffer was too small. I read the value in lpdwBufferLength and changed the initial buffer size to that value (23), and it worked like a charm. Have any idea if I can count on that buffer size, or should my code always involve 2 steps?
<<<

Definitely don't count on anything that low. Usually, in cases like this, I'll go the two pass route, especially for one-shot calls (as opposed to within long loops, etc.). The other option is to just create a ridiculous buffer, say 1024 chars in this case, and chop at the first null.

Just checking the stats on my site (Browser Summary, near the bottom) shows the longest Agent to be "Morning Paper 1.0 (robots.txt compliant!)" -- 41 chars.

Later... Karl

.
Previous
Reply
Map
View

Click here to load this message in the networking platform