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