MFC 如何创建浏览文件夹的对话框

如何创建浏览文件夹的对话框

如何创建浏览文件夹的对话框
CString CXXXXDlg::GetOpenfolderPath()
{
BROWSEINFO bi;
ZeroMemory(&bi,sizeof(BROWSEINFO));
bi.ulFlags = 0x0040 | BIF_EDITBOX;
LPMALLOC pMalloc;
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
CString strFolderPath = "";
char savepath[MAX_PATH];
memset(savepath,,sizeof(savepath));
if(pidl != NULL){
SHGetPathFromIDList(pidl,savepath);
strFolderPath.Format(_T("%s"), savepath);
f (SUCCEEDED(SHGetMalloc(&pMalloc))) {
pMalloc->Free(pidl);
pMalloc->Release();
}
}
return strFolderPath;
}
上一篇:吴恩达机器学习笔记27-样本和直观理解2(Examples and Intuitions II)


下一篇:mybaties 缓存