COMPANY_点取消会卡死的解决方法
// OLD
void ctonedlg::onbtn_basedir_clicked()
{
m_basedir = getUserSelectDir();
doSearchDir(m_basedir);
}
CString getUserSelectDir()
{
pIDList = SHBrowseForFolder(&bi);
if(pIDList)
{
SHGetPathFromIDList(pIDList, ::Buffer);
return TRUE;
}
return FALSE;
}
// NEW
void ctonedlg::onbtn_basedir_clicked()
{
bool bUserClickedOk = false;
m_basedir = getUserSelectDir(bUserClickedOk);
if(!bUserClickedOk)
{
return;
}
doSearchDir(m_basedir);
}
CString getUserSelectDir(bool & bUserClickedOk)
{
pIDList = SHBrowseForFolder(&bi);
if(pIDList)
{
SHGetPathFromIDList(pIDList, ::Buffer);
bUserClickedOk = true;
return TRUE;
}
return FALSE;
}