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. Working dir in Registry

Working dir in Registry

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminquestionworkspace
3 Posts 2 Posters 1 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.
  • R Offline
    R Offline
    RickyC
    wrote on last edited by
    #1

    Hi folks! I'm workig on a application that needs to Run on Windows Startup. Ok, I just set the registry entry "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" to my application, BUT... when the app starts, it loads a dll and this dll load a configuration file in the same dir. When my app loads in startup looks like a shortcut without "Working dir", cause the dll can't load de cfg file. Does have any way to set the "Working dir" in the registry entry? Thanks all for the attention :) Cheers!

    D 1 Reply Last reply
    0
    • R RickyC

      Hi folks! I'm workig on a application that needs to Run on Windows Startup. Ok, I just set the registry entry "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" to my application, BUT... when the app starts, it loads a dll and this dll load a configuration file in the same dir. When my app loads in startup looks like a shortcut without "Working dir", cause the dll can't load de cfg file. Does have any way to set the "Working dir" in the registry entry? Thanks all for the attention :) Cheers!

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

      RickyC wrote: ...cause the dll can't load de cfg file. Why? Is the DLL making assumptions about the location of the configuration file (i.e., using a relative instead of an absolute path)? If the configuration file and the DLL are always in the same folder, I think the DLL should call GetModuleFileName(NULL, ...) instead of using the current working directory.


      "One must learn from the bite of the fire to leave it alone." - Native American Proverb

      R 1 Reply Last reply
      0
      • D David Crow

        RickyC wrote: ...cause the dll can't load de cfg file. Why? Is the DLL making assumptions about the location of the configuration file (i.e., using a relative instead of an absolute path)? If the configuration file and the DLL are always in the same folder, I think the DLL should call GetModuleFileName(NULL, ...) instead of using the current working directory.


        "One must learn from the bite of the fire to leave it alone." - Native American Proverb

        R Offline
        R Offline
        RickyC
        wrote on last edited by
        #3

        The DLL is a different project. But I will take a look. Thanks David.

        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