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. Getting The My Documents Path For Current User

Getting The My Documents Path For Current User

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 Posts 2 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.
  • J Offline
    J Offline
    John Clump
    wrote on last edited by
    #1

    Hello everyone. I am writing a program which is going to create a new folder inside the current user's My Document folder. How do I find the path to the current user's My Document folder? ie. "c:\my documents" on Win98 or "C:\Documents and Settings\SomeUserName\My Documents" in win2000? And what should my application default to when it goes to create datafiles if run on Win95, since there is no "My Documents" folder in Win95? Default to the application's path? I was told by other developers that an application should default to the My Documents folder when creating a new datafile for the first time (like Word does).

    P 1 Reply Last reply
    0
    • J John Clump

      Hello everyone. I am writing a program which is going to create a new folder inside the current user's My Document folder. How do I find the path to the current user's My Document folder? ie. "c:\my documents" on Win98 or "C:\Documents and Settings\SomeUserName\My Documents" in win2000? And what should my application default to when it goes to create datafiles if run on Win95, since there is no "My Documents" folder in Win95? Default to the application's path? I was told by other developers that an application should default to the My Documents folder when creating a new datafile for the first time (like Word does).

      P Offline
      P Offline
      PJ Arends
      wrote on last edited by
      #2

      Use SHGetSpecialFolderPath() with CSIDL_PERSONAL as the nFolder parameter.


      [

      ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

      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