Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 08-25-2005, 16:32
Mkz Mkz is offline
Friend
 
Join Date: Jan 2002
Posts: 98
Rept. Given: 0
Rept. Rcvd 2 Times in 2 Posts
Thanks Given: 5
Thanks Rcvd at 25 Times in 17 Posts
Mkz Reputation: 2
You really should take a look at the documentation for the API's you're using

If you check GetFileSize on MSDN (hxxp://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/getfilesize.asp), you'll see it takes two arguments:
- hFile, a handle to a file that should be obtained from CreateFile
- a pointer to the high-order dword of the size
It will return the low-order dword with the size, or an error code.

The way you're using:
Quote:
Size = GetFileSize(txtFolder.Text)
Size is a String, but it's ok since the result of GetFileSize, which is a Long, will be automatically converted to String.
But you're passing it a String!!! You should pass a handle from CreateFile, and a 2nd Long variable, to receive the high-order dword.

For GetFileTime you have a similar problem, you need to check the API docs to see you must pass the 3 structures to get the 3 filetimes, and not use the function return value as you currently do. For this function, the return value merely indicates if it succeeded or not.

Finally, don't forget to "CloseHandle" after you don't need it any more, as is probably explained in the "CreateFile" docs.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual basic decompiler Zeocrack General Discussion 3 11-24-2022 04:38
[HELP] Visual Basic dll protection Maltese General Discussion 12 08-13-2005 19:05


All times are GMT +8. The time now is 07:23.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )