Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wininet.dll FTP help

Status
Not open for further replies.

Sean7174

Programmer
Jul 17, 2003
13
US
I am using a class module to do some FTP work from a VBA application. The classmodule uses the "FtpFindFirstFileA" function in wininet.dll. It returnes the following:

Private Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type

Private Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAX_PATH
cAlternate As String * 14
End Type

I have seen may different versions of FTP class modules, and they all work the same, so I am sure the code is correct. The problem is, is how do you convert “ftLastWriteTime” into a usuable date? Also, are there unsigned data types in VBA?

 
Maybe these links will get you started. They sort of "go the other way" but I think you'll get the idea.

You create a VB "system time" format Type and a "file time" Type. Then you can call the kernel32 (MAPI?) API function FileTimeToSystemTime( ) and so on to get a "system time" and then you can use DateSerial( ) and TimeSerial( ) on that to end up with a vbDate value if you need it.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top