void CdelDeugDlg::OnBnClickedButton1()
{
// TODO: 在此添加控件通知处理程序代码
CString sFolderPath;
BROWSEINFO bi;
char Buffer[MAX_PATH];
//初始化bi
bi.hwndOwner = NULL;
bi.pidlRoot = NULL;//根目录
bi.pszDisplayName = Buffer;//此参数如为NULL则不能显示对话框
bi.lpszTitle = "修改接收路径";
bi.ulFlags = BIF_EDITBOX;//包括文件
bi.lpfn = NULL;
bi.iImage = IDR_MAINFRAME;
//调用显示选择对话框
LPITEMIDLIST plDList = SHBrowseForFolder(&bi);
if(plDList)
{
//获得路径到buffer
SHGetPathFromIDList(plDList,Buffer);
sFolderPath = Buffer;
}
LPMALLOC lpMalloc;
if(FAILED(SHGetMalloc(&lpMalloc)))
return;
//释放内存
lpMalloc->Free(plDList);
lpMalloc->Release();
}
{
// TODO: 在此添加控件通知处理程序代码
CString sFolderPath;
BROWSEINFO bi;
char Buffer[MAX_PATH];
//初始化bi
bi.hwndOwner = NULL;
bi.pidlRoot = NULL;//根目录
bi.pszDisplayName = Buffer;//此参数如为NULL则不能显示对话框
bi.lpszTitle = "修改接收路径";
bi.ulFlags = BIF_EDITBOX;//包括文件
bi.lpfn = NULL;
bi.iImage = IDR_MAINFRAME;
//调用显示选择对话框
LPITEMIDLIST plDList = SHBrowseForFolder(&bi);
if(plDList)
{
//获得路径到buffer
SHGetPathFromIDList(plDList,Buffer);
sFolderPath = Buffer;
}
LPMALLOC lpMalloc;
if(FAILED(SHGetMalloc(&lpMalloc)))
return;
//释放内存
lpMalloc->Free(plDList);
lpMalloc->Release();
}