[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

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

John H

11/6/2008 3:45:00 PM

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
2 Answers

Ashutosh Bhawasinka

11/6/2008 5:10:00 PM

0

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.


John H wrote:
> 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
>

John H

11/10/2008 1:07:00 PM

0

On Nov 6, 5:10 pm, Ashutosh Bhawasinka <discuss...@ashutosh.in> wrote:
> 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.
>
>
>
> John H wrote:
> > 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- Hide quoted text -
>
> - 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