16,472
社区成员
发帖
与我相关
我的任务
分享
CString m_cfg_return_pathname(CString m)
wchar_t drive[100];
wchar_t dir[100];
wchar_t fname[100];
wchar_t ext[100];
wchar_t *m1={0};
m.ReleaseBuffer();
_wsplitpath_s( m, drive, dir, fname, ext );
CString l;
l+=drive;
l+=dir;
l.Replace(__T("\\"),__T("\\\\"));
return l;
strFileName=("./log/")+strSN+_T(".ini"); //初始化生成的文本路径,文件名,扩展名
CFile file(strFileName,CFile::modeCreate|CFile::modeReadWrite|CFile::shareDenyNone);//创建指定strFileName文本
#include <shlwapi.h>
CString m_cfg_return_pathname(const CString& filePath)
{
CString pathPart = filePath;
PathRemoveFileSpec(pathPart.GetBuffer(MAX_PATH));
pathPart.ReleaseBuffer();
return pathPart;
}