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. CFileDialog question

CFileDialog question

Scheduled Pinned Locked Moved C / C++ / MFC
question
8 Posts 3 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.
  • C Offline
    C Offline
    color Aljechin
    wrote on last edited by
    #1

    I am using CFileDialog to select multiple files. When I select single file, the member function GetPathName(). But when multiple files are selected the folder path is returned. How do I get the path of all the files that are selected.

    :rose:

    D P 2 Replies Last reply
    0
    • C color Aljechin

      I am using CFileDialog to select multiple files. When I select single file, the member function GetPathName(). But when multiple files are selected the folder path is returned. How do I get the path of all the files that are selected.

      :rose:

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Did you not read the documentation? It plainly states that: If m_ofn.Flags has the OFN_ALLOWMULTISELECT flag set, you should call GetStartPosition() and GetNextPathName() to retrieve a file pathname.


      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

      "Judge not by the eye but by the heart." - Native American Proverb

      C 1 Reply Last reply
      0
      • C color Aljechin

        I am using CFileDialog to select multiple files. When I select single file, the member function GetPathName(). But when multiple files are selected the folder path is returned. How do I get the path of all the files that are selected.

        :rose:

        P Offline
        P Offline
        prasad_som
        wrote on last edited by
        #3

        Use this loop ,

          POSITION pos = dlg.GetStartPosition();
          while (pos != NULL)
          {
             CString sFileName = dlg.GetNextPathName(pos);
          }
        

        -- modified at 10:05 Friday 6th October, 2006

        Prasad Notifier using ATL | Operator new[],delete[][^]

        C 2 Replies Last reply
        0
        • P prasad_som

          Use this loop ,

            POSITION pos = dlg.GetStartPosition();
            while (pos != NULL)
            {
               CString sFileName = dlg.GetNextPathName(pos);
            }
          

          -- modified at 10:05 Friday 6th October, 2006

          Prasad Notifier using ATL | Operator new[],delete[][^]

          C Offline
          C Offline
          color Aljechin
          wrote on last edited by
          #4

          Thank you very much.

          :rose:

          1 Reply Last reply
          0
          • D David Crow

            Did you not read the documentation? It plainly states that: If m_ofn.Flags has the OFN_ALLOWMULTISELECT flag set, you should call GetStartPosition() and GetNextPathName() to retrieve a file pathname.


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

            "Judge not by the eye but by the heart." - Native American Proverb

            C Offline
            C Offline
            color Aljechin
            wrote on last edited by
            #5

            I asked a doubt and I give 5 when I am helped. I dont know who is the fool that is giving a low rating to a person who replied to *me*. 5/5 for both of you.

            :rose:

            D 1 Reply Last reply
            0
            • P prasad_som

              Use this loop ,

                POSITION pos = dlg.GetStartPosition();
                while (pos != NULL)
                {
                   CString sFileName = dlg.GetNextPathName(pos);
                }
              

              -- modified at 10:05 Friday 6th October, 2006

              Prasad Notifier using ATL | Operator new[],delete[][^]

              C Offline
              C Offline
              color Aljechin
              wrote on last edited by
              #6

              I asked a doubt and I give 5 when I am helped. I dont know who is the fool that is giving a low rating to a person who replied to *me*. 5/5 for both of you.

              :rose:

              P 1 Reply Last reply
              0
              • C color Aljechin

                I asked a doubt and I give 5 when I am helped. I dont know who is the fool that is giving a low rating to a person who replied to *me*. 5/5 for both of you.

                :rose:

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                Just ignore the voting system. It's so easily abused, the numbers mean nothing.


                "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                "Judge not by the eye but by the heart." - Native American Proverb

                1 Reply Last reply
                0
                • C color Aljechin

                  I asked a doubt and I give 5 when I am helped. I dont know who is the fool that is giving a low rating to a person who replied to *me*. 5/5 for both of you.

                  :rose:

                  P Offline
                  P Offline
                  prasad_som
                  wrote on last edited by
                  #8

                  As said by David , just ignore it.:)

                  Prasad Notifier using ATL | Operator new[],delete[][^]

                  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