AW: [libertybasic] Directory Short Name
> Hi All:
> I'm trying to use the MS Directory "Program Files" in a path for
> an ODBC32
> call. I enclosed it in quotes but am getting problems perhaps because of
> the space in the MS Directory name and I don't think ODBC likes
> the quotes.
> There is a short name for this Directory but I couldn't find it on google.
> Anyone know it off-hand? I know there is LB code to get short names (I'm
> not sure if that is even what I'm looking for) but if it is I can
> try that
the prefered way to get the short form of a path is using the API function
filedialog "Select a file", DefaultDir$ + "\*.*", FileName$
if FileName$ <> "" then
print "Long Filename: "; FileName$
print "Short Filename: "; GetShortPathName$(FileName$)
print "Finished ..."
lpszLongPath$ = lpszLongPath$ + chr$(0)
cchBuffer = _MAX_PATH + 1
lpszShortPath$ = space$(cchBuffer) + chr$(0)
calldll #kernel32, "GetShortPathNameA", _
lpszLongPath$ as ptr, _
lpszShortPath$ as ptr, _
cchBuffer as ulong, _
result as ulong
case result = 0
GetShortPathName$ = "ERROR encountered!"
case result > cchBuffer
cchBuffer = result
GetShortPathName$ = trim$(lpszShortPath$)
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de