
Need to get the short filename from a long filename
Make sure that you are specifying a suitable value in the final paramater
(how many
characters to return); i.e.
sn$ = space(256)
call GetShortPathName(ln$, sn$, 256&)
Quote:
> I've tried using the GetShortPathName function, but it doesn't return
> anything to my program in the parameter passed as lpszShortPath. The
> string goes in blank and comes out blank. Any suggestions as what where
> my mistake may be?
When you call an API function that fills a string buffer you need to make
certain that it is initialized to the maximum number of possible characters
you expect to be returned. I used 128, which is more than necessary for
this function, before making the call:
lpszShortPath = Space$(128)
--
Paul
~~~~
----------