Information générale
Catégorie:
Codage, syntaxe et commandes
>
>The short file name doesn't exist until the file is written to the disk. If the file name doesn't exist yet, there's no short path to return.
You must have missed the code that I supplied. I hard code the path name. Let me show you again.
declare integer GetShortPathName in Win32API string, string, integer
lcLongFile = "c:\program files\somefolder\my file name.doc"
lcBuffer = SPACE(100)
lnBufferSize = 101
lnShortPathLen = GetShortPathName(lcLongFile, @lcBuffer, lnBufferSize)
MessageBox(alltrim(str(lnShortPathLen))+[ | ]+alltrim(lcBuffer),16,[Short Path Name])
return
You can't get any simpler then this. Please, please try this out on your system and let me know if it works. The long file name is hard coded, so it does exist. lcLongFile = "c:\program files\somefolder\my file name.doc". Even this simple code will not work for me.
DJ :o)
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement