Funciones en power builder
Me pregunto si puedes ayudarme con unos problemitas que tengo. Resulta que estoy tratando de utilizar unas funciones de la librería Kernel32, pero tengo varios errores que no se en que consisten, creo que es problema de llamado o algo así, me tomo el atrevimiento de enviarte el código de lo que he avanzado para ver si puedes darme alguna sugerencia al respecto, te agradezco de antemano y espero una pronta respuesta. Gracias.
Protoripos de las funciones:
Locales:
Function ulong FindFirstFile (string lpFileName, ref WIN32_FIND_DATAA
lpFindFileData) LIBRARY "KERNEL32.DLL"
Function boolean FileTimeToSystemTime (ref FILETIME lpFileTime, ref SYSTEMTIME lpSystemTime)
LIBRARY "KERNEL32.DLL"
Function boolean FileTimeToLocalFileTime (ref FILETIME lpFileTime, ref FILETIME lpLocalFileTime)
LIBRARY "KERNEL32.DLL"
Externas:
FUNCTION uint FindWindowA (long classname, string windowname) LIBRARY "user32.dll"
Estructuras utilizadas:
global type filetime from structure
ulong dwlowdatetime
ulong dwhighdatetime
end type
global type systemtime from structure
long wyear
long wmonth
long wdayofweek
long wday
long whour
long wminute
long wsecond
long wmillisecond
end type
global type win32_find_dataa from structure
unsignedlong dwfileattributes
filetime ftcreationtime
filetime ftlastaccesstime
filetime ftlastwritetime
unsignedlong nfilesizehigh
unsignedlong nfilesizelow
unsignedlong dwreserved0
unsignedlong dwreserved1
character cfilename[260]
character calternatefilename[14]
end type
codigo:
WIN32_FIND_DATAA lfd_lpFindFileData, lfd_lpFindFileData_Local
systemtime lst_lpSystemTime
string ls_pathname
boolean prueba
datetime fversion
ls_pathname = "c:salida empeje1.exe"
prueba = FileExists (ls_pathname)
IF prueba THEN
FindFirstFile (ls_pathname, lfd_lpFindFileData)
FileTimeToLocalFileTime (lfd_lpFindFileData.ftlastwritetime, lfd_lpFindFileData_Local.ftlastwritetime)
if FileTimeToSystemTime (lfd_lpFindFileData_Local.ftlastwritetime, lst_lpSystemTime) then
fversion = (datetime (date (lst_lpSystemTime.wyear, lst_lpSystemTime.wmonth, lst_lpSystemTime.wday), &
time (lst_lpSystemTime.whour, lst_lpSystemTime.wmimute)) , "mm/dd/yyyy hh:ss")
end if
END IF
messagebox ("Fecha archivo", ls_pathname + " - " + string(fversion))
Protoripos de las funciones:
Locales:
Function ulong FindFirstFile (string lpFileName, ref WIN32_FIND_DATAA
lpFindFileData) LIBRARY "KERNEL32.DLL"
Function boolean FileTimeToSystemTime (ref FILETIME lpFileTime, ref SYSTEMTIME lpSystemTime)
LIBRARY "KERNEL32.DLL"
Function boolean FileTimeToLocalFileTime (ref FILETIME lpFileTime, ref FILETIME lpLocalFileTime)
LIBRARY "KERNEL32.DLL"
Externas:
FUNCTION uint FindWindowA (long classname, string windowname) LIBRARY "user32.dll"
Estructuras utilizadas:
global type filetime from structure
ulong dwlowdatetime
ulong dwhighdatetime
end type
global type systemtime from structure
long wyear
long wmonth
long wdayofweek
long wday
long whour
long wminute
long wsecond
long wmillisecond
end type
global type win32_find_dataa from structure
unsignedlong dwfileattributes
filetime ftcreationtime
filetime ftlastaccesstime
filetime ftlastwritetime
unsignedlong nfilesizehigh
unsignedlong nfilesizelow
unsignedlong dwreserved0
unsignedlong dwreserved1
character cfilename[260]
character calternatefilename[14]
end type
codigo:
WIN32_FIND_DATAA lfd_lpFindFileData, lfd_lpFindFileData_Local
systemtime lst_lpSystemTime
string ls_pathname
boolean prueba
datetime fversion
ls_pathname = "c:salida empeje1.exe"
prueba = FileExists (ls_pathname)
IF prueba THEN
FindFirstFile (ls_pathname, lfd_lpFindFileData)
FileTimeToLocalFileTime (lfd_lpFindFileData.ftlastwritetime, lfd_lpFindFileData_Local.ftlastwritetime)
if FileTimeToSystemTime (lfd_lpFindFileData_Local.ftlastwritetime, lst_lpSystemTime) then
fversion = (datetime (date (lst_lpSystemTime.wyear, lst_lpSystemTime.wmonth, lst_lpSystemTime.wday), &
time (lst_lpSystemTime.whour, lst_lpSystemTime.wmimute)) , "mm/dd/yyyy hh:ss")
end if
END IF
messagebox ("Fecha archivo", ls_pathname + " - " + string(fversion))
Respuesta de Antonio Garcia
1