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. Create Directory

Create Directory

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

    is there a way to create a directory like this "C:\somedir\subdir1\subdir2\subdir3" when the directory "C:\somedir" does not already exist? i have tried using CreateDirectory() but it seems to be only able to handle one directory at a time,

    J 1 Reply Last reply
    0
    • A Archer282

      is there a way to create a directory like this "C:\somedir\subdir1\subdir2\subdir3" when the directory "C:\somedir" does not already exist? i have tried using CreateDirectory() but it seems to be only able to handle one directory at a time,

      J Offline
      J Offline
      Jack Puppy
      wrote on last edited by
      #2

      SHCreateDirectory

      :suss: Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
      Painted on the side of a dog trainer's van: SIT HAPPENS

      A 1 Reply Last reply
      0
      • J Jack Puppy

        SHCreateDirectory

        :suss: Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
        Painted on the side of a dog trainer's van: SIT HAPPENS

        A Offline
        A Offline
        Archer282
        wrote on last edited by
        #3

        hmm, none of the headers i have for Visual C++ seem to have this function, nor do any of the headers for Dev-C++ (MinGW),

        J D 2 Replies Last reply
        0
        • A Archer282

          hmm, none of the headers i have for Visual C++ seem to have this function, nor do any of the headers for Dev-C++ (MinGW),

          J Offline
          J Offline
          Jack Puppy
          wrote on last edited by
          #4

          Minimum operating systems Windows 2000 You'd have to change your _WIN32_WINNT define in stdafx.h to 0x0500. I don't think there is another way of doing it unless you write your own routine using splitpath or the like.

          Painted on the side of a dog trainer's van: SIT HAPPENS

          P 1 Reply Last reply
          0
          • J Jack Puppy

            Minimum operating systems Windows 2000 You'd have to change your _WIN32_WINNT define in stdafx.h to 0x0500. I don't think there is another way of doing it unless you write your own routine using splitpath or the like.

            Painted on the side of a dog trainer's van: SIT HAPPENS

            P Offline
            P Offline
            picasso2
            wrote on last edited by
            #5

            This would work system("MD c:\\somedir\\sundir1\\sundir2\\sundir3");

            1 Reply Last reply
            0
            • A Archer282

              hmm, none of the headers i have for Visual C++ seem to have this function, nor do any of the headers for Dev-C++ (MinGW),

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

              You'll need the Platform SDK. Look in Shlobj.h.


              "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

              A 1 Reply Last reply
              0
              • D David Crow

                You'll need the Platform SDK. Look in Shlobj.h.


                "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

                A Offline
                A Offline
                Archer282
                wrote on last edited by
                #7

                I really hate to be mean, but perhaps you should read more carefully "none of the headers i have for Visual C++" that would include "shlobj.h"

                D 1 Reply Last reply
                0
                • A Archer282

                  I really hate to be mean, but perhaps you should read more carefully "none of the headers i have for Visual C++" that would include "shlobj.h"

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

                  Most folks that pose such a question about missing functions are ignorant to the fact that a Platform SDK even exists, or that perhaps it contains newer prototypes. I was just making sure you had not overlooked that. Glad you're ok!


                  "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

                  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