muttiple file selection
-
hi i m trying to select the multiple files through the file open dialog box for that purpose i used that code. according to the MSDN to select multiple file the m_ofn.lpstrFile file ptr should pt to new buffer u had allocated. i had done that. CFileDialog *object=new CFileDialog(TRUE,(LPCTSTR)"shp",NULL,OFN_ALLOWMULTISELECT,"Shape File |*.shp|",NULL); char *filename; object->m_ofn.lpstrFile= filename; // here it give the assertion. object->m_ofn.nMaxFile=sizeof(filename); if(object->DoModal()!= IDCANCEL) MessageBox(object->m_ofn.lpstrFile,"ptr"); i want the file names that had been selected through file dialog. what to do. ddd
-
hi i m trying to select the multiple files through the file open dialog box for that purpose i used that code. according to the MSDN to select multiple file the m_ofn.lpstrFile file ptr should pt to new buffer u had allocated. i had done that. CFileDialog *object=new CFileDialog(TRUE,(LPCTSTR)"shp",NULL,OFN_ALLOWMULTISELECT,"Shape File |*.shp|",NULL); char *filename; object->m_ofn.lpstrFile= filename; // here it give the assertion. object->m_ofn.nMaxFile=sizeof(filename); if(object->DoModal()!= IDCANCEL) MessageBox(object->m_ofn.lpstrFile,"ptr"); i want the file names that had been selected through file dialog. what to do. ddd
Use the CFileDialog::GetStartPosition() / CFileDialog::GetNextPathName() functions http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/\_mfc\_cfiledialog.3a3a.getstartposition.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/\_mfc\_cfiledialog.3a3a.getnextpathname.asp HTH