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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Programmatically copying a folder in MFC

Programmatically copying a folder in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorial
6 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.
  • A Offline
    A Offline
    Ashman
    wrote on last edited by
    #1

    Hi, I need to know how to copy a folder and all the contents within to another location set by the user. Because the folders content is read only, I want to be able to make ReadOnly(FALSE); Is this possible, please help! Thanks in advance Ashman

    P 1 Reply Last reply
    0
    • A Ashman

      Hi, I need to know how to copy a folder and all the contents within to another location set by the user. Because the folders content is read only, I want to be able to make ReadOnly(FALSE); Is this possible, please help! Thanks in advance Ashman

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      SHFileOperation will help out, its very good api to work around with files and folder.


      "When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)

      A 1 Reply Last reply
      0
      • P Prakash Nadar

        SHFileOperation will help out, its very good api to work around with files and folder.


        "When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)

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

        Thanks I searched for SHFileOperation() API calls and I don't understand how to implement it in my program. Do you have/know of an example that I can use. What I want to do is very basic; transfer 2 folders with all their files intact from location: D:\Programming\NeriedPOS\nbsSetup\nPOS & D:\Programming\NeriedPOS\nbsSetup\nManager to C:\Program Files\nPOS with ReadOnly(FALSE) Would you kindly be able to show me how to do that using SHFileOperation() or any other API? Please help...its kinda urgent considering I have almost run out of hair to pull :) Thanks Ashman

        D 1 Reply Last reply
        0
        • A Ashman

          Thanks I searched for SHFileOperation() API calls and I don't understand how to implement it in my program. Do you have/know of an example that I can use. What I want to do is very basic; transfer 2 folders with all their files intact from location: D:\Programming\NeriedPOS\nbsSetup\nPOS & D:\Programming\NeriedPOS\nbsSetup\nManager to C:\Program Files\nPOS with ReadOnly(FALSE) Would you kindly be able to show me how to do that using SHFileOperation() or any other API? Please help...its kinda urgent considering I have almost run out of hair to pull :) Thanks Ashman

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

          This

          SHFILEOPSTRUCT shfo = {0};
          shfo.wFunc = FO_COPY;
          shfo.pFrom = "D:\\Programming\\NeriedPOS\\nbsSetup\\nPOS\\*.*\0";
          shfo.pTo = "C:\\Program Files\\nPOS\0";
          SHFileOperation(&shfo);

          should get you started.


          A rich person is not the one who has the most, but the one that needs the least.

          A 1 Reply Last reply
          0
          • D David Crow

            This

            SHFILEOPSTRUCT shfo = {0};
            shfo.wFunc = FO_COPY;
            shfo.pFrom = "D:\\Programming\\NeriedPOS\\nbsSetup\\nPOS\\*.*\0";
            shfo.pTo = "C:\\Program Files\\nPOS\0";
            SHFileOperation(&shfo);

            should get you started.


            A rich person is not the one who has the most, but the one that needs the least.

            A Offline
            A Offline
            Ashman
            wrote on last edited by
            #5

            Have I ever told you I love you? :) Thanks heaps

            D 1 Reply Last reply
            0
            • A Ashman

              Have I ever told you I love you? :) Thanks heaps

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

              Ashman wrote: Thanks heaps You're welcome stacks!


              A rich person is not the one who has the most, but the one that needs the least.

              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