Apis to create multi instances of a service ala sql 2005 instances

J

John H

Hi,
I have a windows nt service ( written in C++ ) lets call it
dowork.exe.
I would like to run another instance of it excatly like sql 2005 does
when you create another database instance.


Anyone know how to do this.?

Thanks very much

John
 
A

Ashutosh Bhawasinka

All the SQL server's exe runs for different Service Names, which
includes the instance name.

You can't have more than 1 copies of the exe running for a single
service. You can create any number of services (in a single exe) you
want but the names (of the service) must be different. So, in your exe
you could write code to register and run for 2 (or more) services. So,
this way same exe can be launched for different services....Just like
svchost.exe

If all you want is just 2 copies of exe and the instances has nothing to
offer as a service, you could directly launch your 2nd exe as a normal
child process from your service's process.
 
J

John H

All the SQL server's exe runs for different Service Names, which
includes the instance name.

You can't have more than 1 copies of the exe running for a single
service. You can create any number of services (in a single exe) you
want but the names (of the service) must be different. So, in your exe
you could write code to register and run for 2 (or more) services. So,
this way same exe can be launched for different services....Just like
svchost.exe

If all you want is just 2 copies of exe and the instances has nothing to
offer as a service, you could directly launch your 2nd exe as a normal
child process from your service's process.








- Show quoted text -

Thanks for the reply.
I need to create an arbitrary number but it will be triggered by a
user action e.g I want to provision a new service instance when a
customer is added , just like when a new sql instance is created in
sql 2005.
How does sql 2005 achieve this so I can use same logic/api's?

Thanks again.
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top