Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with CFileDialog

Status
Not open for further replies.

WilliamGS

Programmer
Jan 21, 2004
54
0
0
PE
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
 
MSDN said:
If IDCANCEL is returned, call the WindowsCommDlgExtendedError function to determine whether an error occurred.

/Per
[sub]
www.perfnurt.se[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top