开发者

setCurrentDrive? c++ win32

开发者 https://www.devze.com 2022-12-13 06:36 出处:网络
How can I set the current drive in c++?I was unable to fi开发者_JAVA百科nd anything on the MSDN siteAccording to thr MSDN docs on the Win API, SetCurrentDirectory will also set the current drive.The s

How can I set the current drive in c++? I was unable to fi开发者_JAVA百科nd anything on the MSDN site


According to thr MSDN docs on the Win API, SetCurrentDirectory will also set the current drive.


The string you use to set the directory can be prefixed by the drive letter -- i.e., "c:\program files".

Directories are set relative to your programs current working directory. If you start your program from 'X' drive you will not be able to move outside of 'X' using relative conventions/directory addressing. You need to use a directory string prefixed with the correct drive letter.

0

精彩评论

暂无评论...
验证码 换一张
取 消