i have an INI file that needs to be in a specific directory (i'd like to avoid this) or in a relative directory to the EXE. I tried using GetCurrentDirectory() but that gives me the calling application's directory, not the EXE that uses GetCurrentDirectory(). ( i wrote an EXE that is called from other applications).
so, what i need to know is how do i get my application's directory, regardless of what calls it (shortcut, link, another exe). if this isn't possible, i'd settle for placing it in the root directory. i'd like to avoid the registry if possible, but i'll most likely give up and do that in about 2 hours.
thanks,
Nytyme
example:
i have MyApp.Exe and MyApp.ini in C:\MyApp, if i active MyApp.Exe from there everything is fine. if i click a link from an email, i want my application to launch (it does), but it looks for the INI file where my email app sits. this is where my error comes in. i know i can specify its location in the registry. but i'd like to use something programmatic so that it knows "if EXE is in this folder, then so is INI".
so, what i need to know is how do i get my application's directory, regardless of what calls it (shortcut, link, another exe). if this isn't possible, i'd settle for placing it in the root directory. i'd like to avoid the registry if possible, but i'll most likely give up and do that in about 2 hours.
thanks,
Nytyme
example:
i have MyApp.Exe and MyApp.ini in C:\MyApp, if i active MyApp.Exe from there everything is fine. if i click a link from an email, i want my application to launch (it does), but it looks for the INI file where my email app sits. this is where my error comes in. i know i can specify its location in the registry. but i'd like to use something programmatic so that it knows "if EXE is in this folder, then so is INI".