Dear Lou,
I read your problem and read the SDK for the SHFILEOPSTRUCT structure. There I found that both the members pFrom and pTo must be double NULL-terminated. See the explicit warning at:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb759795(v=vs.85).aspx
Maybe this helps?
Robert





Windows API (SHFileOperation)
Hi,
I'm getting a crash when I call SHFileOperation and I suspect it may have something to do with the sh.pFrom structure member which is defined as INTEGER (LPCSTR) in INFWINTY.F90. Any help would be greatly appreciated.
Program DelDirRecursive
USE IFPORT
USE IFWIN
implicit none
character*256 cString
integer ierr, kerr
TYPE (T_SHFILEOPSTRUCT) sh
cString = ' '
sh.hwnd = NULL
sh.wFunc = FO_DELETE
sh.pFrom = 'ABC'C
sh.pTo = NULL
sh.fFlags = FOF_SILENT
sh.fAnyOperationsAborted = NULL
sh.hNameMappings = 0
sh.lpszProgressTitle = NULL
ierr = SHFileOperation (sh)
if (ierr .ne. 0) print *,' I/O Error'
if (ierr .eq. 0) print *,' Success'
stop
end