Hello guys
I'm trying to read file size, modification date and file type from all files in a given path.
The idea is to simulate a Windows Explorer inside a PB window.
I'm not aware of an object or function inside Appeon, so I will use any of the following APIs from Kernell32.dll
- GetfileSize
- GetFileInformationByHandle
For simplicity, I will use GetFileSize
I declared the external global function GetFileSize as:
Function long GetFileSize (long hFile, double lpFileSizeHigh) Library "Kernell32.dll"
I open the file with ll_file = fileopen(filename) ( ll_file declared as long )
I get "Bad runtime function reference" error.
I assume "long Hfile" is a bad variable declaration, but don't know how to declare it inside PB as docs.microsoft.com shows:
Should it be an structure data type instead of long?
Thanks for the feedback
The first is a 16-bit integer value (typically, a very small number) that PB assigns to a file you open so that you can easily refer to it in other PB functions.
The second is a 32- or 64-bit integer (as are all Windows handles) that Windows assigns so that you can refer to the file in other Windows API functions.
I'll reiterate my earlier suggestion to download and examine the FileSys free sample application that Roland Smith graciously provides to the PB community. While I commend your desire to get this to work on your own, I think you would learn as much or more with less effort and frustration by looking at the code in Roland's small app. However, the choice is yours. of course. Good luck!
I downloaded and created the library for the FileSys tool from Roland Smith's web page.
It's beautiful !!!
It cleared up all my doubts and opened my eyes to new stuff I was not aware of.
That tool is exactly what I was trying to implement
Thank you so much again guys !! ( John, Chris and Roland !!! )