Robert,
My email account has been down for the past few day so I do not know
if you received an answer yet, if not here goes:
For an application to function as a service there are several things that
it needs to do:
- register itself with the SCM (service control manager)
- in main it must call StartServiceCtrlDispatcher() to
connect the main thread of execution to the SCM
- implement ServiceMain() for each process in the service
- setup a handler to deal with stop/start/pause/continue requests
In addition, you may want to check the load time for your service and make
sure that it is loaded and running before a user logs in - this is not
a given. (I was working on a replacement for msgina.dll and wanted to
log events to the event log, however it turned out that sometimes the
logging worked and other times it did not. I eventually tracked this
down to the event service not fully running when a user was attempting
to log in).
For more informtion on developing services, check MSDN as well as
Miller, Kevin “Professional NT Services”, Wrox Publishers 1998
ISBN # 1-861001-30-4
(this is the only book on NT servies that I am aware of)
George Huber
Computer Scientist
SRI, International
phone: 732-427-8064
fax : 732-427-2065
xxxxx@mail1.monmouth.army.mil
-----Original Message-----
From: robert.3.tucker@bt.com [mailto:robert.3.tucker@bt.com]
Sent: Friday, August 24, 2001 8:17 AM
To: NT Developers Interest List
Subject: [ntdev] NT System Service
Hi,
I wonder if anyone can help me.
Ive written a small C++ program, and I need it to be run every time the
system starts, before login.
The program is a ‘heartbeat’ program, so this is necessary.
I have been told I need to run it as a service, but NT wont accept it as a
service, so I assume there is some code I need to put into the program to
allow this.
Any help would be appreciated,
Rob Tucker.
You are currently subscribed to ntdev as:
xxxxx@mail1.monmouth.army.mil
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com