mfc 如何通过checkbox控件选择文件夹路径

我创建一个mfc 工程, 如何通过checkbox控件弹出一个对话框选择文件夹路径,并获取该文件夹的路径。求大神指导

勾上check box后,就调用跳出文件选择对话框

 CString strFilePath;
TCHAR pszBuffer[_MAX_PATH];
BROWSEINFO bi;  LPITEMIDLIST pidl;
bi.hwndOwner = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = pszBuffer;
bi.lpszTitle = _T("&NCString strFilePath;
TCHAR pszBuffer[_MAX_PATH];
BROWSEINFO bi;  LPITEMIDLIST pidl;
bi.hwndOwner = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = pszBuffer;
bi.lpszTitle = _T("Ñ¡Ôñ²¥³ö±í·¾¶");
bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
bi.lpfn = NULL;
bi.lParam = 0;
if((pidl = SHBrowseForFolder(&bi)) != NULL)
{
if(SHGetPathFromIDList(pidl, pszBuffer))
{
CString strTemp(pszBuffer);   strFilePath = strTemp;
if (strFilePath.GetLength() <= 1) 
{
}
else if (strFilePath.Right(1) != _T("\\"))  
strFilePath += _T("\\");
}
}
GetDlgItem(IDC_STATIC_PATH)->SetWindowText(strFilePath);tilde;&iexcl;&Ocirc;&ntilde;&sup2;&yen;&sup3;&ouml;±í&Acirc;·&frac34;&para;");
bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
bi.lpfn = NULL;
bi.lParam = 0;
if((pidl = SHBrowseForFolder(&bi)) != NULL)
{
if(SHGetPathFromIDList(pidl, pszBuffer))
{
CString strTemp(pszBuffer);   strFilePath = strTemp;
if (strFilePath.GetLength() <= 1) 
{
}
else if (strFilePath.Right(1) != _T("\\"))  
strFilePath += _T("\\");
}
}
GetDlgItem(IDC_STATIC_PATH)->SetWindowText(strFilePath);