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. MultiSelect CFileDialog (Open)

MultiSelect CFileDialog (Open)

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 Posts 4 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.
  • N Offline
    N Offline
    ns
    wrote on last edited by
    #1

    According to MSDN for CString GetPAthNAme():

    If m_ofn.Flags has the OFN_ALLOWMULTISELECT flag set, this string contains a sequence of null-teminated strings, with the first string being the directory path of the file group selected, followed by the names of all files selected by the user.
    

    Now if I assign the result of calling GetPathName(), the CString I assign it to only reads in upto the first null. So how to I get a hold of the complete list of files returned by getPAthNAme()?

    CString a = dlg1.GetPAthName();

    and its multiselect.... Thanks, ns

    L J R 3 Replies Last reply
    0
    • N ns

      According to MSDN for CString GetPAthNAme():

      If m_ofn.Flags has the OFN_ALLOWMULTISELECT flag set, this string contains a sequence of null-teminated strings, with the first string being the directory path of the file group selected, followed by the names of all files selected by the user.
      

      Now if I assign the result of calling GetPathName(), the CString I assign it to only reads in upto the first null. So how to I get a hold of the complete list of files returned by getPAthNAme()?

      CString a = dlg1.GetPAthName();

      and its multiselect.... Thanks, ns

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      Use GetStartPosition() and GetNextPathName() to iterate thru the list of names. /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com

      1 Reply Last reply
      0
      • N ns

        According to MSDN for CString GetPAthNAme():

        If m_ofn.Flags has the OFN_ALLOWMULTISELECT flag set, this string contains a sequence of null-teminated strings, with the first string being the directory path of the file group selected, followed by the names of all files selected by the user.
        

        Now if I assign the result of calling GetPathName(), the CString I assign it to only reads in upto the first null. So how to I get a hold of the complete list of files returned by getPAthNAme()?

        CString a = dlg1.GetPAthName();

        and its multiselect.... Thanks, ns

        J Offline
        J Offline
        jmkhael
        wrote on last edited by
        #3

        Read about: GetStartPosition and GetNextPathName hint: u get a position from the first, u put it into the other! Papa while (TRUE) Papa.WillLove ( Bebe ) ;

        1 Reply Last reply
        0
        • N ns

          According to MSDN for CString GetPAthNAme():

          If m_ofn.Flags has the OFN_ALLOWMULTISELECT flag set, this string contains a sequence of null-teminated strings, with the first string being the directory path of the file group selected, followed by the names of all files selected by the user.
          

          Now if I assign the result of calling GetPathName(), the CString I assign it to only reads in upto the first null. So how to I get a hold of the complete list of files returned by getPAthNAme()?

          CString a = dlg1.GetPAthName();

          and its multiselect.... Thanks, ns

          L Offline
          L Offline
          Lakitu
          wrote on last edited by
          #4

          You have to use GetStartPosition() and GetNextPathName() to iterate through the list of files. If a train station is where the train stops, what's a workstation...?

          N 1 Reply Last reply
          0
          • L Lakitu

            You have to use GetStartPosition() and GetNextPathName() to iterate through the list of files. If a train station is where the train stops, what's a workstation...?

            N Offline
            N Offline
            ns
            wrote on last edited by
            #5

            I got misled by MSDN (my fault)....thanks for pointing me in the right direction... Thanks, ns

            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