|
-
August 24th, 2001, 11:54 AM
#1
filetimetosystemtime won't work
Keep getting an error " Bad dll calling convention" Here's a sample of the code
Dim findinfo as WIN32_FIND_DATA
Dim hsearch as Long
Dim success as Long
Dim localtime as FILETIME
Dim systime as SYSTEMTIME
Dim retval as Long
Dim gFile as string
'create a buffer
findinfo.cFileName = string(MAX_PATH, 0)
'find the first file
hsearch = FtpFindFirstFile(hConnection, "*.*", findinfo, 0, 0)
'if there's no file, then exit sub
If hsearch = 0 then
Debug.print "(no files matched search parameter)"
End
End If
gFile = Left(findinfo.cFileName, InStr(1, findinfo.cFileName, string(1, 0), vbBinaryCompare) - 1)
Do
'create a buffer
findinfo.cFileName = string(MAX_PATH, 0)
' Convert UTC FILETIME to local SYSTEMTIME and display the date:
retval = FileTimeToLocalFileTime( findinfo.ftCreationTime, localtime)
'**********HERE'S WHERE I get THE error
retval = FileTimeToSystemTime(localtime, systime)
'*****************************************
Debug.print "date:"; systime.wMonth; "-"; _
systime.wDay; "-"; systime.wYear
'find the next file
success = InternetFindNextFile(hsearch, findinfo)
'show the filename
gFile = Left(findinfo.cFileName, InStr(1, findinfo.cFileName, string(1, 0), vbBinaryCompare)) '- 1)
Loop Until success = 0
'close the search handle
InternetCloseHandle hsearch
Exit Sub
Am I missing something. I'm new at using API and am trying to learn this stuff.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|