CString CMediaplayerDlg::GetCurrentPath()
{
wchar_t wcurPath[MAX_PATH];
memset(wcurPath,0,MAX_PATH);
GetCurrentDirectory(MAX_PATH,wcurPath);
CString pStrPath;
pStrPath.Append(wcurPath);
return pStrPath;
}
本文介绍了一个使用 C++ 编写的简单函数,该函数用于获取当前目录的路径。通过调用 GetCurrentDirectory 函数并利用 CString 类进行字符串操作,实现了路径的获取与返回。
CString CMediaplayerDlg::GetCurrentPath()
{
wchar_t wcurPath[MAX_PATH];
memset(wcurPath,0,MAX_PATH);
GetCurrentDirectory(MAX_PATH,wcurPath);
CString pStrPath;
pStrPath.Append(wcurPath);
return pStrPath;
}

被折叠的 条评论
为什么被折叠?