On 16 Sep 99, at 14:17, Wayne Bonnett wrote:
> Hi All! I need to write a program within VB and it needs to be an NT
> service. Can anyone tell me what I need to do so that the app I am writing
> runs as a service?
These two requirements *may* be in conflict with each other. In
order to run as a service, an executable has to register with the
service manager, and as part of that registration I believe it
provides a pointer to a service-control routine. In older versions
of VB, I know that it wasn't possible to construct an acceptible
pointer to a VB function for this purpose. [I am not certain whether
this is still true.]
The best book I know of on writing NT services is published by WROX
Press: "Professional NT Services" by Kevin Miller. See
http://www.amazon.com/exec/obidos/ASIN/1861001304/o/qid=937563496/sr
=2-1/002-6494178-5161060
(That should be all one line....)
Unfortunately, all of the examples are in C.
It is possible to launch other executables from a service; in fact,
I believe there's a utility called SRVANY.EXE to do just that. You
may be able to get away with writing your code as a VB application
and using this sort of utility to run it as a service.
I've also been able to sidestep implementing stuff as services
sometimes by having the Schedule service launch the application.
This might also work in your case.
David G
PCSOFT's List Owner's:
Bob Wright<[log in to unmask]>
Drew Dunn<[log in to unmask]>
|