bkhugui  

总有这样一个API被人遗忘在角落,

从文件路径获取目录名:
Desc:Removes the trailing file name and backslash from a path, if it has them.
 
Syntax
BOOL PathRemoveFileSpec( LPTSTR pszPath)
 
HEADR:shlwapi.h
 
 

TCHAR PathStr[MAX_PATH];
GetModuleFileName(NULL, PathStr, MAX_PATH);
PathRemoveFileSpecW(PathStr);
CString str;
str.Format(L"%s\\book.mdb", PathStr);

posted on 2017-02-21 11:14  bkhugui  阅读(757)  评论(0)    收藏  举报