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. How to set working directory to MyPictures?

How to set working directory to MyPictures?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++comtutorial
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
    segment_fault
    wrote on last edited by
    #1

    Using Win32/VC++, I want to scan the users My Pictures folder (and potentially any other user/system folder using: g_hFind= FindFirstFile( "*.jpg", &g_FindFileData); and FindNextFile(g_hFind, &g_FindFileData) ) How do I set the "working" folder so that I don't need to include the path name as part of the file path? hr = SHGetSpecialFolderLocation(0, CSIDL_COMMON_PICTURES, &pidlDocFiles); Thanks in advance, If you're interested, read more of what I have to say my DirectX9 site. - Segment Fault

    K P 2 Replies Last reply
    0
    • S segment_fault

      Using Win32/VC++, I want to scan the users My Pictures folder (and potentially any other user/system folder using: g_hFind= FindFirstFile( "*.jpg", &g_FindFileData); and FindNextFile(g_hFind, &g_FindFileData) ) How do I set the "working" folder so that I don't need to include the path name as part of the file path? hr = SHGetSpecialFolderLocation(0, CSIDL_COMMON_PICTURES, &pidlDocFiles); Thanks in advance, If you're interested, read more of what I have to say my DirectX9 site. - Segment Fault

      K Offline
      K Offline
      khan
      wrote on last edited by
      #2

      I guess you could use: SetCurrentDirectory(strPath); But you still need to get the path first using SHGetSpecialFolderLocation() etc. this is this.

      1 Reply Last reply
      0
      • S segment_fault

        Using Win32/VC++, I want to scan the users My Pictures folder (and potentially any other user/system folder using: g_hFind= FindFirstFile( "*.jpg", &g_FindFileData); and FindNextFile(g_hFind, &g_FindFileData) ) How do I set the "working" folder so that I don't need to include the path name as part of the file path? hr = SHGetSpecialFolderLocation(0, CSIDL_COMMON_PICTURES, &pidlDocFiles); Thanks in advance, If you're interested, read more of what I have to say my DirectX9 site. - Segment Fault

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

        Think of a situation that the user changes that folder location (yes he can) while ur application is running. Your application will stop behaving properly if you have cached the path or set it as a default path. IMO, i wont do that.


        -Prakash -- modified at 3:45 Wednesday 4th January, 2006

        C 1 Reply Last reply
        0
        • P Prakash Nadar

          Think of a situation that the user changes that folder location (yes he can) while ur application is running. Your application will stop behaving properly if you have cached the path or set it as a default path. IMO, i wont do that.


          -Prakash -- modified at 3:45 Wednesday 4th January, 2006

          C Offline
          C Offline
          Chintoo723
          wrote on last edited by
          #4

          I think it is okay to ignore this case for all practical purposes. You will have the problem either way you do it: either change the current directory and relative file names, or get the location of My Pictures folder and use absolute name. When you are working on a directory and the directory has changes, the behaviour is unknown anyways. thanks!

          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