码迷,mamicode.com
首页 > Windows程序 > 详细

文件路径获取目录API

时间:2017-02-21 11:46:37      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:null   move   efi   files   esc   mod   orm   har   文件路径   

总有这样一个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);

文件路径获取目录API

标签:null   move   efi   files   esc   mod   orm   har   文件路径   

原文地址:http://www.cnblogs.com/hugui/p/6423180.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!