I wrote mfc c++ console application. This Application is using “a dll” and this dll use one “xml file” for store some datas.
I need multiple process for my design and also I can start multiple process from my application at the start time with “Windows Service Application”.They are running as a “System Process”.They work nice.
Normally if my application runs as a user process,XML File is created in same directory with process. But If it runs as System process, XML File is created in “C:\Windows\SysWOW64” folder by dll. So all processes are using same xml file.
Problem is Dll wasn’t written by me so i cant change anything on it. Can i do something for this?
My OS is “Windows Server 2008 R2”
thnx in advance
During installation of service, you can set command line parameter for example: -directory c:\MyAppFolder. In your application get this parameter and change working directory by SetCurrentDirectory method. Dll you are calling creates xml file in working directory, which will be c:\MyAppFolder. If you create more services make sure each of them has unique directory.