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. How to detect subdirectories

How to detect subdirectories

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
5 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    e.g I have a variable CString path; How can I find out the subdirectories of this folder?

    L 1 Reply Last reply
    0
    • L Lost User

      e.g I have a variable CString path; How can I find out the subdirectories of this folder?

      L Offline
      L Offline
      l a u r e n
      wrote on last edited by
      #2

      look at FindFirstFile() FindNextFile() its in the returned flags value --- "every year we invent better idiot proof systems and every year they invent better idiots"

      L 1 Reply Last reply
      0
      • L l a u r e n

        look at FindFirstFile() FindNextFile() its in the returned flags value --- "every year we invent better idiot proof systems and every year they invent better idiots"

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Thanks! can I use FILE_ATTRIBUTE_DIRECTORY in the WIN32_FIND_DATA structure, to find subdirectories? One more question: these functions return a handle. How can I find out what the name of the directories is?

        L N 2 Replies Last reply
        0
        • L Lost User

          Thanks! can I use FILE_ATTRIBUTE_DIRECTORY in the WIN32_FIND_DATA structure, to find subdirectories? One more question: these functions return a handle. How can I find out what the name of the directories is?

          L Offline
          L Offline
          l a u r e n
          wrote on last edited by
          #4

          as far as i remember the cFileName member holds the file / directory name :) --- "every year we invent better idiot proof systems and every year they invent better idiots"

          1 Reply Last reply
          0
          • L Lost User

            Thanks! can I use FILE_ATTRIBUTE_DIRECTORY in the WIN32_FIND_DATA structure, to find subdirectories? One more question: these functions return a handle. How can I find out what the name of the directories is?

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

            WIN32_FIND_DATA is a struct: typedef struct _WIN32_FIND_DATA { DWORD dwFileAttributes; FILETIME ftCreationTime; FILETIME ftLastAccessTime; FILETIME ftLastWriteTime; DWORD nFileSizeHigh; DWORD nFileSizeLow; DWORD dwReserved0; DWORD dwReserved1; TCHAR cFileName[ MAX_PATH ]; TCHAR cAlternateFileName[ 14 ]; } WIN32_FIND_DATA, *PWIN32_FIND_DATA; this is in MSDN welcome you to Sky...

            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