Tech Support > Microsoft Windows > Development Resources > Multiple instance synchronization
Multiple instance synchronization
Posted by bilaribilari@yahoo.com on October 4th, 2006


Hello,
I have a program that runs as a service. It reads its parameters from a
file currently. The name of the file is hard-coded in the program.
Now the problem arises because I can start multiple instances of my
program. Each instance may have different parameters. Each of them gets
installed as a service (so the 'service name' has to be different as
well). I am thinking of using the registry to store values in something
like this:
Key: HKEY_LOCAL_MACHINE-->SOFTWARE-->MyProgram-->1
Values: Param1, Param2, Param3

Key: HKEY_LOCAL_MACHINE-->SOFTWARE-->MyProgram-->2
Values: Param1, Param2, Param3

Key: HKEY_LOCAL_MACHINE-->SOFTWARE-->MyProgram-->3
Values: Param1, Param2

Here the number following MyProgram is the instance ID, and the values
are the parameters that are needed by the program.

My question is: What is a better way to engineer this?

Thanks in advance.
Best regards.


Similar Posts