No announcement yet.

long and short filenames...

  • Filter
  • Time
  • Show
Clear All
new posts

  • Michael Mattias
    >Basically, the call tanks,

    You can query the return of GetShortPathName and use GetLastError() if it failed to get a reason for the failure.

    Insufficient code shown but I'll make some guesses

    You might be missing a "\" after ProgPath before '"+parse.text"'

    parse.txt might not exist. (GetShortPathName fails if file does not exist).

    If shortdest is a STRING you must initialize and pass its LEN and address of the data,
    not its SIZEOF (=4) and the address of its handle.


    Leave a comment:

  • C.M. Rouleau
    started a topic long and short filenames...

    long and short filenames...


    I downloaded a command line app that does conversion, and it will only accept short filenames on the command line. This isn't a problem because after I use a open file dialog to get the source file, I pass that filename to GetShortPathName, and voila - I have a short filename source to feed to the conversion app. However, my problem happens when I try to use the same process to build a short destination filename as follows:

    'create a long destination manually

    'now make the call
    GetShortPathName(longDest, shortDest, SIZEOF(shortDest))

    Basically, the call tanks, and I don't get my short filename destination. What do you suppose was so right about the string passed from the open file dialog, and that which I created manually?