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. Setting temporary file path

Setting temporary file path

Scheduled Pinned Locked Moved C / C++ / MFC
jsonhelpworkspace
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.
  • V Offline
    V Offline
    Vinaya
    wrote on last edited by
    #1

    Hi, I have an application which uses 3 custom DLL. I want to create an additional DLL with method which sets the path of the temporary files created (from the application as well as the other DLLs) to a specified path rather than the system temp file path. If this method of the new DLL is not called in the application, the application can use the system temp path for creating temporary files. I tried using '_putenv()' for setting the environment variable 'TMP' with the new path for temp files, in my new DLL and then calling it from my application. But this does not change the path where the temp files from the DLL are created. It is affecting only the temporary files created from the application. I use the GetTempPath() API to get the temp path. Is there any other method to change the temporary file path. I need the new temp path to affect the methods of all the DLLs. Pls help. Thanks Vini

    D 1 Reply Last reply
    0
    • V Vinaya

      Hi, I have an application which uses 3 custom DLL. I want to create an additional DLL with method which sets the path of the temporary files created (from the application as well as the other DLLs) to a specified path rather than the system temp file path. If this method of the new DLL is not called in the application, the application can use the system temp path for creating temporary files. I tried using '_putenv()' for setting the environment variable 'TMP' with the new path for temp files, in my new DLL and then calling it from my application. But this does not change the path where the temp files from the DLL are created. It is affecting only the temporary files created from the application. I use the GetTempPath() API to get the temp path. Is there any other method to change the temporary file path. I need the new temp path to affect the methods of all the DLLs. Pls help. Thanks Vini

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

      The only way I know of is to update the values in the HKEY_CURRENT_USER\Environment key.


      "Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow

      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