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. get all folder names ?

get all folder names ?

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 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.
  • S Offline
    S Offline
    sam_psycho
    wrote on last edited by
    #1

    How can I get all folder names if specified folder, lets say "c:\new folder\" I want names of the all folder in new folder

    J H R 3 Replies Last reply
    0
    • S sam_psycho

      How can I get all folder names if specified folder, lets say "c:\new folder\" I want names of the all folder in new folder

      J Offline
      J Offline
      Jijo Raj
      wrote on last edited by
      #2

      Hello VCD, You can use - CFileFind::FindFile()[^] and CFileFind::FindNextFile()[^] to iterate through all files and folders in specified folder. Call CFileFind::IsDirectory()[^] to check whether the current found file/folder is a directory. Regards, Jijo.

      _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

      1 Reply Last reply
      0
      • S sam_psycho

        How can I get all folder names if specified folder, lets say "c:\new folder\" I want names of the all folder in new folder

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        You can us of FindFirstfile and see an example of this function:Code for finding out the total number of files & folders existing in a folder through VC++[^].

        Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

        1 Reply Last reply
        0
        • S sam_psycho

          How can I get all folder names if specified folder, lets say "c:\new folder\" I want names of the all folder in new folder

          R Offline
          R Offline
          rwilmink
          wrote on last edited by
          #4

          Use FindFirstFile and FindNextFile. The WIN32_FIND_DATA member dwFileAttributes will tell you if the file is a directory. Cheers, Ronald.

          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