Morya

wxStandardPaths().GetDataDir()

wxStandardPaths().GetDataDir()

这个函数可以用来非常方便的取得exe的位置。(Manual)

可是用vc编译的debug版却没有包含最后的debug目录。
很是疑惑啊!
以为vc添加了什么神奇的东西。
看了
wxStandardPaths::GetDataDir() 的源代码,
1 wxString wxStandardPaths::GetDataDir() const
2 {
3    // under Windows each program is usually installed in its own directory and
4    // so its datafiles are in the same directory as its main executable
5    return GetAppDir();
6 }

 1 wxString wxStandardPaths::GetAppDir()
 2 {
 3    wxFileName fn(wxGetFullModuleName());
 4 
 5    // allow running the apps directly from build directory in debug builds
 6 #ifdef __WXDEBUG__
 7    wxString lastdir;
 8    if ( fn.GetDirCount() )
 9    {
10       lastdir = fn.GetDirs().Last();
11       lastdir.MakeLower();
12       if ( lastdir.Matches(_T("debug*")) || lastdir.Matches(_T("vc_msw*")) )
13       fn.RemoveLastDir();
14    }
15 }
16 

posted on 2009-04-12 20:27 Morya 阅读(580) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


导航

<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

统计

常用链接

留言簿(1)

随笔档案(21)

文章档案(1)

最新评论

评论排行榜