Advertisement

GetFileSize() in VB

Started by November 18, 2000 11:02 PM
1 comment, last by vbisme 24 years, 1 month ago
Private Declare Function GetFileSize Lib "kernel32" (ByVal hFile As Long, lpFileSizeHigh As Long) As Long Dim TempFileNum As Long TempFileNum = FreeFile Dim TempHigh As Long Open "somefile.fil" For Binary As TempFileNum Dim FileSize As Long FileSize = GetFileSize(TempFileNum, TempHigh) The GetFileSize always return -1, what is wrong?
You should just use FileLen(FileNumber)
it will give you the langth of the file
the API requres you to open the file with
the file API Engine
.....
-Killer
Advertisement
Opps sorry
it FileLen(FileName as string) as long
...
-Killer

This topic is closed to new replies.

Advertisement