Hello, I have a CFileDialog with multiple selection and open mode, when I select the files with click on the first one then shift+click on the last one and close the dialog with “Open” button, DoModal() returns IDCANCEL!!!, but when I select the files with Ctrl+Click it works fine. I work with VC6.00 and Windows 2000. This is my code:
void COrgDocTemplatesDlg::OnBtnSelect()
{
CFileDialog dlg( TRUE, NULL, NULL,
OFN_HIDEREADONLY|OFN_FILEMUSTEXIST|OFN_EXPLORER
|OFN_ALLOWMULTISELECT|OFN_PATHMUSTEXIST,
NULL, this);
if( dlg.DoModal() != IDOK )
return;
POSITION pos = dlg.GetStartPosition();
while (pos)
{
strFile = dlg.GetNextPathName(pos);
m_lstSelFiles.InsertItem(0, dlg.GetNextPathName(pos));
}
}
Please, help me. Thanks in advance.
William GS
void COrgDocTemplatesDlg::OnBtnSelect()
{
CFileDialog dlg( TRUE, NULL, NULL,
OFN_HIDEREADONLY|OFN_FILEMUSTEXIST|OFN_EXPLORER
|OFN_ALLOWMULTISELECT|OFN_PATHMUSTEXIST,
NULL, this);
if( dlg.DoModal() != IDOK )
return;
POSITION pos = dlg.GetStartPosition();
while (pos)
{
strFile = dlg.GetNextPathName(pos);
m_lstSelFiles.InsertItem(0, dlg.GetNextPathName(pos));
}
}
Please, help me. Thanks in advance.
William GS