J
Just_a_fan
I looked at the help and googled a bit and decided I had the right idea.
Starting with KFTP from PSC, I wanted to get the remote file last write
time. The results was a GPF trying to write protected memory. Here's
the setup. Any pointers appreciated.
Standard stuff here:
Private Structure WIN32_FIND_DATA
Dim dwFileAttributes As Integer
Dim ftCreationTime As FILETIME
Dim ftLastAccessTime As FILETIME
Dim ftLastWriteTime As FILETIME
Dim nFileSizeHigh As Integer
Dim nFileSizeLow As Integer
Dim dwReserved0 As Integer
Dim dwReserved1 As Integer
<VBFixedString(MAX_PATH),
System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr,
SizeConst:=MAX_PATH)> Public cFileName As String
<VBFixedString(14),
System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr,
SizeConst:=14)> Public cAlternate As String
End Structure
Private Structure FILETIME
Private dwLowDateTime As Int32
Private dwHighDateTime As Int32
End Structure
Private Declare Function FileTimeToSystemTime Lib "kernel32" (ByVal
lpFileTime As FILETIME, ByVal lpSystemTime As SYSTEMTIME) As Long
Dim pData As WIN32_FIND_DATA
Dim st As SYSTEMTIME
FileTimeToSystemTime(pData.ftLastWriteTime, st)
And there is the GPF.
The data in ftLastWriteTime looks good. Two words of numbers, high and
low. Immediate windows shows it just right.
If I am doing something just plain stupid, just let me know. Still
learning .NET here.
Mike
Starting with KFTP from PSC, I wanted to get the remote file last write
time. The results was a GPF trying to write protected memory. Here's
the setup. Any pointers appreciated.
Standard stuff here:
Private Structure WIN32_FIND_DATA
Dim dwFileAttributes As Integer
Dim ftCreationTime As FILETIME
Dim ftLastAccessTime As FILETIME
Dim ftLastWriteTime As FILETIME
Dim nFileSizeHigh As Integer
Dim nFileSizeLow As Integer
Dim dwReserved0 As Integer
Dim dwReserved1 As Integer
<VBFixedString(MAX_PATH),
System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr,
SizeConst:=MAX_PATH)> Public cFileName As String
<VBFixedString(14),
System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr,
SizeConst:=14)> Public cAlternate As String
End Structure
Private Structure FILETIME
Private dwLowDateTime As Int32
Private dwHighDateTime As Int32
End Structure
Private Declare Function FileTimeToSystemTime Lib "kernel32" (ByVal
lpFileTime As FILETIME, ByVal lpSystemTime As SYSTEMTIME) As Long
Dim pData As WIN32_FIND_DATA
Dim st As SYSTEMTIME
FileTimeToSystemTime(pData.ftLastWriteTime, st)
And there is the GPF.
The data in ftLastWriteTime looks good. Two words of numbers, high and
low. Immediate windows shows it just right.
If I am doing something just plain stupid, just let me know. Still
learning .NET here.
Mike