🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #12342

Re: how to write a service application which will install with different service name?

#12342
From: Radom�r �krib
Date: Thu, 11 Dec 2003 12:31
39 lines
2603 bytes
Yes, i found this solution yesterday and it works. Thanks.

"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message
news:3fd76181$1@newsgroups.borland.com...
>
> "Radom�r �krib" <radomir.skrib@visicom.sk> wrote in message
> news:3fd721f6$1@newsgroups.borland.com...
>
> > I have created a service application, which perform various tasks on
> > the database, but we have on one computer more then one database
> > and i want create for each database one service, an because this is
> > the same exe, each service must have a different name. How it is
> > possible to do this???
>
> TService is not really designed to be used in that manner, so there is no
> direct way to do what you ask.  If you only have 1 TService in your
> application, then you would have to dynamically change the Service's Name
> property during installation as well as when the service is actually
> starting.  You would need to pass the Service's new name as a command-line
> parameter so that the service code could look at that and update its Name
> property appropriately.
>
> Otherwise, what you really should do is create separate TService classes,
> one for each database type that you want to support.  A
TServiceApplication
> can host multiple TService classes inside of itself, each one independant
of
> each other.
>
> However, if you choose to only have a single TService that changes its
Name,
> then that is not going to change which database is being accessed at
> runtime, so how are you planning on telling the service which database to
> access per instance of the service?
>
>
> Gambit
>
>
Technical Details
Message-ID: <3fd862af@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fd721f6$1@newsgroups.borland.com> <3fd76181$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10cc67,cfd6066f72b8cc59
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-12-11 04:39:20 PST
From: "Radom�r �krib" <radomir.skrib@visicom.sk>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3fd721f6$1@newsgroups.borland.com> <3fd76181$1@newsgroups.borland.com>
Subject: Re: how to write a service application which will install with different service name?
Date: Thu, 11 Dec 2003 13:31:20 +0100
Lines: 41
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 195.168.45.30
Message-ID: <3fd862af@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1071145647 195.168.45.30 (11 Dec 2003 04:27:27 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail