Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. muttiple file selection

muttiple file selection

Scheduled Pinned Locked Moved C / C++ / MFC
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _tasleem
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • _ _tasleem

      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

      P Offline
      P Offline
      pablo_mag
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups