Thanks, I finally got it to work, but now there is another problem.
If I select a small number of files, it works. If I select a larger number of files (+5), it exits the loop as if I had clicked "cancel" in the dialog box.
- CFileDialog cfileDlg( TRUE, _T("*.cpf"), NULL, OFN_ALLOWMULTISELECT, _T("CPF Files (*.cpf)|*.cpf|" ));
-
-
CString csFileDlgTitle;
-
-
cfileDlg.m_ofn.lpstrTitle = csFileDlgTitle;
-
-
//int nRet = cfileDlg.DoModal( );
-
//ASSERT( ( nRet != IDOK ) || ( nRet != IDCANCEL ) );
-
-
if (cfileDlg.DoModal() != IDOK) {
-
return; //EXITS HERE IF I SELECT A LOT OF FILES, REGARDLESS OF WHAT I CLICK//
-
}
-
-
POSITION pos ( cfileDlg.GetStartPosition() );
-
-
while( pos )
-
{
-
CString csFileName( cfileDlg.GetNextPathName( pos ) );
-
-
FileOpenInput(csFileName);
The code that was commented out worked before, I took it out for other reasons.
I marked where the function terminates. That if statement is meant to be entered if the user clicks cancel in the File Open dialog box. What is the reason for this?
Thanks