Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WinInet troubleshooting
Message
From
30/06/2000 07:21:59
 
 
To
06/04/2000 15:37:55
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00356440
Message ID:
00386986
Views:
17
>>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. 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.
>

INTEGER and LONG in a DLL declaration are identical to VFP, both representing a signed 32 bit integer - SHORT is a signed 16 bit integer, but the docs imply that SHORT can be used for a return type not a parameter type. If you pass an INTEGER by reference where a SHORT is really required, make certain to use BITAND(nIntegerReturnValue,0xFFFF) to mask off the low order bits to make sure there's no garbage left strewn about. A handle is always a 32 bit integer, so either declaration is correct, regardless. A 32 bit value with the most significant bit set will be represented to VFP as a negative number, but you can use a hex value like 0xFFFFFFFF.
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
Reply
Map
View

Click here to load this message in the networking platform