marcus78
asked on
Long name from DOS short name
Hi - Say that I have a CString that contains a valid file name, but it uses the short name like "C:\progra~1\my~1.txt"
How can I get a CString that looks like:
1 - "C:\Program Files\My File.txt"
and (not required, but would be nice)
2 - "\\mymachine\c\Program Files\My File.txt"
My main target is NT4.0.
Any help would be great.
How can I get a CString that looks like:
1 - "C:\Program Files\My File.txt"
and (not required, but would be nice)
2 - "\\mymachine\c\Program Files\My File.txt"
My main target is NT4.0.
Any help would be great.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops - forgot the link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/filesio_0cyt.asp
I think you have it backwards jkr. :) I believe marcus78 wants GetLongPathName() instead...
You are right :o)
ASKER
Crius, you're right I do want the long path, just haven't been able to try it out yet. I'll get back to you and jkr later.
ASKER
Crius, GetLongPathName() isn't supported in NT 4.0, so I couldn't use that. Thanks for pointing it out though.
jkr, while GetShortPathName was the opposite of what I needed, it put me on the right track to end up using FindFirstFile. I was able to use this to determine the long path in NT 4.0. Thanks for your help!
Marcus
jkr, while GetShortPathName was the opposite of what I needed, it put me on the right track to end up using FindFirstFile. I was able to use this to determine the long path in NT 4.0. Thanks for your help!
Marcus