C++ MFC

Moderators: Lundin
Number of threads: 3337
Number of posts: 9005

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
converting file path to dos based Posted by kashifmunir on 1 Jun 2003 at 11:28 PM
I have the full path of a file in a CString variable. I want to convert this file path to dos-based path (the 8.3 convention). If anyone can provide me with the code.

Thanx in advance
Kashif
Report
Re: converting file path to dos based Posted by DB1 on 2 Jun 2003 at 1:18 AM
: I have the full path of a file in a CString variable. I want to convert this file path to dos-based path (the 8.3 convention). If anyone can provide me with the code.
:
: Thanx in advance
: Kashif
:

There's a few ways to do it.

You can use the WIN_32_FIND_DATA structure along with FindFirstFile() etc.. and get the file's name in the classic 8.3 filename format through the "cAlternateFileName" struct member.

Or, you can use the GetShortPathName() function which "obtains the short path form of a specified input path."






To understand recursive, first you need to understand recursive

Report
Re: converting file path to dos based Posted by Dennis Dingen on 9 Jun 2003 at 3:32 AM
: : I have the full path of a file in a CString variable. I want to convert this file path to dos-based path (the 8.3 convention). If anyone can provide me with the code.
: :
: : Thanx in advance
: : Kashif
: :
:
: There's a few ways to do it.
:
: You can use the WIN_32_FIND_DATA structure along with FindFirstFile() etc.. and get the file's name in the classic 8.3 filename format through the "cAlternateFileName" struct member.
:
: Or, you can use the GetShortPathName() function which "obtains the short path form of a specified input path."
:
:
:
:
:
:
: To understand recursive, first you need to understand recursive
:
:
hi there, ofcourse some functions are available to convert you path..I want to give you an alternative..DOS uses the 8.3 format. So every filename of dir-name is truncated to 8 chars..example
c:\program files -> c:\progra~1
c:\mysettings.txt -> c:\mysett~1.txt

if you need to, you can write a procedure for doing this..

Good luck to yaa...




Grz,
Bl@ckBl@de <Feedback: void_void@hotmail.com>




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.