🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#12336
From: Remy Lebeau (TeamB)
Date: Wed, 10 Dec 2003 18:14
30 lines
2511 bytes
"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: <3fd76181$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3fd721f6$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-10 10:15:56 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3fd721f6$1@newsgroups.borland.com>
Subject: Re: how to write a service application which will install with different service name?
Date: Wed, 10 Dec 2003 10:14:51 -0800
Lines: 32
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: 67.23.78.224
Message-ID: <3fd76181$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1071079809 67.23.78.224 (10 Dec 2003 10:10:09 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail