Using PB703 Build 10213
Tryng to force the dialog box "GetFileOpenName" to open at a specific
folder. I use WIN API Fuctions
"GetCurrentDirectoryA" and "SetCurrentDirectoryA".
Most of the time, the script execute successfully for 2 to 3 times. After
that the aplication termimates - either the next time this process is
triggered or when the window is closed!
Sample script:
ufx_GetCurrentDirectoryA(255, orig_directory/*ref*/)
ufx_SetCurrentDirectoryA(new_path)
GetFileOpenName("Select Picture", s_targer_path/*ref*/, s_filename/*ref*/,
'BMP', 'Bitmap Files (*.bmp)')
/* Process s_filename */
ufx_SetCurrentDirectoryA(orig_directory/)
Any thoughts or comments?
Thank you
MAX_PATH is 260, not 255. But rather than using a hardcoded length, why not
use the proper logic to determine the length of the path? Did you
pre-allocate the space for orig_directory, since GetCurrentDirectory stores
the path in your application's memory? You are also not checking the return
value from these external function calls - are you certain they are
succeeding? Did you know that these same functions were implemented in the
pfc file service?
String ls_origpath
Integer li_rtn, li_buflen = 260
ls_origpath = Space(li_buflen)
li_rtn = GetCurrentDirectoryA(li_buflen, ls_origpath)
"Stelios Stylianou" <pios...@piosarota.com.cy> wrote in message
news:4ae5b8d6@forums-1-dub...