I have developed a database engine which needs to be run at a periodic time.
I would like to have the program run as a service under Windows NT or Windows
2000 but I don't know if this is something that I need to program into my
database or it is simply launching the program with the correct command line
option.
Could someone shed some light on my problem?
Thanks
The New Guy
The program architecture of a service is completely different from the
architecture of a GUI program or console program and requires calls to
the Service Control Manager APIs. If you would rather not revise your
program extensively you could try the SrvAny utility that comes in the
NT resource kit. It is a tiny service that can launch your existing
app. This is not the best solution for production but it is very easy
to evaluate :)
--
Scott McPhillips [VC++ MVP]
Try WROX 'Professional NT Services' by Kevin Miller. www.bookpool.com is
a good place to get it.
You will need to use the NT SCM to create (and potentially remove) your
service and it needs to have a few simple service specific bits, but
mostly its really easy. One thing - it's usually a very bad thing from a
security standpoint to have services interact directly with a logged on
user. Typically a good design will use a second executable that runs in
the users logon session to talk to the service, or the service can have
a thread attach to the correct desktop and impersonate the logged on
user.
If you want I can send you a simple service in source code form. Write
me at charli...@nai.com
Charlie
>I would like to have the program run as a service under Windows NT or Windows
>2000 but I don't know if this is something that I need to program into my
>database or it is simply launching the program with the correct command line
>option.
>
The answer is depends on language you used. For instance, most
applications written in Delphi 3/4/5/6 uses SvCom (www.aldyn.ru) for
creating services. SvCom can emulate Service API even in Win9X.
---
Sincerely yours,
Nik Mokhnatov, n...@softilium.com
Softilium Development Group, http://www.softilium.com
*** SVA : The best tool to distribute your software in the Internet.
*** PatchBase : Your personal software's knowledgebase.