DanielRoca
Programmer
Hi, I'm programing a small NT Service app in Delphi 7, and I need to load an ini file in order to get some parameters, when I do for example:
ConfigIni:= TIniFile.Create('C:\Config.ini');
an obviously put the ini file in that path every thing works fine, but I would like to get the ini file not from a fixed path in the code but from the same path where the myservice.exe es located, to do that I've try two metods that work fine in a normal app but for some reason do not in the service
ConfigIni:= TIniFile.Create(ExpandFileName('Config.ini'));
or
ConfigIni:= TIniFile.Create(GetCurrentDir+'Config.ini');
any ideas why is this happening and of course how can I make this work.
Thanks.
ConfigIni:= TIniFile.Create('C:\Config.ini');
an obviously put the ini file in that path every thing works fine, but I would like to get the ini file not from a fixed path in the code but from the same path where the myservice.exe es located, to do that I've try two metods that work fine in a normal app but for some reason do not in the service
ConfigIni:= TIniFile.Create(ExpandFileName('Config.ini'));
or
ConfigIni:= TIniFile.Create(GetCurrentDir+'Config.ini');
any ideas why is this happening and of course how can I make this work.
Thanks.