GetDiskFreeSpace problems!

hasnain_razwi

Member
Joined
Oct 21, 2003
Messages
15
Location
Melbourne, Australia
hi. im using an API to calculate the free space on my hard disk. this is the line that i use to call the API: -

lngReturn = GetDiskFreeSpace(strDrive, lngSectorPerCluster, lngBytesPerSector, lngFreeClusters, lngTotalClusters)

where the value of strDrive is "C:/ ". the trouble is no matter what value i put in strDrive, i keep getting the same result for the rest of the parameters i.e 0,0,0,0. (ofcourse thats not right :mad: ) and since there isnt any error, i cant tell where the mistake is.

one more thing, is there an API viewer like application like the one available in VB 6 where we could copy the declaration code from the viewer window and paste it into the code?
 
PlausiblyDamp said:
How have you declared the API? does it work with "C:\"?

nope stil doesnt
it doesnt even give me an error when i put in an empty string. just doesnt work. the declaration is as follows :-

Public Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, ByVal lpSectorsPerCluster As Long, ByVal lpBytesPerSector As Long, ByVal lpNumberOfFreeClusters As Long, ByVal lpTotalNumberOfClusters As Long) As Long
 
Back
Top