Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetDiskFreeSpaceEx return negative value on overflow condit
Message
From
02/01/2001 14:48:10
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
GetDiskFreeSpaceEx return negative value on overflow condit
Miscellaneous
Thread ID:
00458588
Message ID:
00458588
Views:
105
This code works on small drives with a parameter type of integer.
On large drives it return -1.0697E+9 with a parameter type of integer and
0.000E+0 with a parameter type of double.
Does anyone know how to set this up correctly to return the correct byte count for all drive sizes.

PUBLIC lpPathName, lpBytesToCall, lpTotalDiskBytes, lpFreeBytes
lpPathName = "A:\"
lpBytesToCall = 9
lpTotalDiskBytes = 9
lpFreeBytes = 9

DECLARE INTEGER GetDiskFreeSpaceEx IN WIN32API AS FREESPACE STRING @lpPathName,;
integer @lpBytesToCall, integer @lpTotalDiskBytes, integer @lpFreeBytes

RetVal = FREESPACE( @lpPathName, @lpBytesToCall, @lpTotalDiskBytes, @lpFreeBytes)
? "Path Free/Call Total/Bytes Free/Bytes"
? lpPathName
?? space(6)
?? lpBytesToCall
?? space(6)
?? lpTotalDiskBytes
?? space(6)
?? lpFreeBytes
Next
Reply
Map
View

Click here to load this message in the networking platform