总有这样一个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);
时间: 2024-10-12 04:49:12