A function to retrieve the directory of a program

I've needed to get the directory a program was running several times. I've used it to determine where configuration files could be found. I've used it for determining where images should be stored/loaded. I've also had to write it from scratch several times :( . I'm submitting it here so hopefully someone else doesn't have to figure it out themselves.

I've found that using _getcwd isn't accurate whenever the user is allowed to use the file dialogs to open or save files. If they move to a different directory in the file dialogs, the current working directory is changed as well


It's not much, but I've found it helpful and hope that someone else will as well.

http://www.codeproject.com/tips/programdir.asp?df=100&forumid=3336&exp=0&select=121652

阅读更多
文章标签: function path file user
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

A function to retrieve the directory of a program

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭