Global Function
FUNCTION ulong SHGetFolderPath (ulong hWndOwner, int nFolder, long
hToken, ulong dwFlags, ref string pszpath) LIBRARY "shell32.dll"
and in the routine
CONSTANT ulong SHGFP_TYPE_CURRENT = 0 // Return the folder's current
path
CONSTANT int CSIDL_APPDATA = 26
CONSTANT long MAX_LENGTH_PATH = 255
int PathResult
string ls_path
ls_path = space(MAX_LENGTH_PATH)
if SHGetFolderPath(0, CSIDL_APPDATA, 0, SHGFP_TYPE_CURRENT, ls_path)
<> 0 then
MessageBox("Application Error", "Failed to return user application
folder.")
Else
ls_path = ls_path + “\DistApps”
if DirectoryExists( ls_path ) then
else
CreateDirectory( ls_path )
end If
end if
It compiles OK, but when I run the program, I get:
Error: Bad runtime function reference at line 40 in open event of
object hr_report.
The SHGetFolderPath function call is line 40.
Any help would be appreciated.
--
Report Bugs: http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement
"Gordon" <gordon....@citi.com> wrote in message
news:6aaff8b4-0e17-4ed8...@c14g2000yqm.googlegroups.com...
This example on my website uses SHGetFolderPathW. The zipfile contains an
example for PB8 and PB10. You will want to use the PB10 one and convert it
to 11.5.
http://www.topwizprogramming.com/freecode_filesys.html
Roland
"Gordon" <gordon....@citi.com> wrote in message
news:6aaff8b4-0e17-4ed8...@c14g2000yqm.googlegroups.com...
Thanks Roland, that was exactly what I needed.
Thanks Jerry, that's news to me. But we are implementing on Windows
XP so I can't use the SHGetKnownFolderPath function.