Solved

Simple NT Service.

Posted on 2001-06-25
8
124 Views
Last Modified: 2010-05-18
Could someone give me a basic sample of an NT service please.  I've never written one, looked into writing one, or even considered it before now, but I need to do one.  So, if someone could, I'd just like a simple service example that includes the code for handling starting, stopping, and doing something in between.

I do want code for this please, and any explanation of the process if possible.

Thanks,

John.
0
Comment
Question by:Jaymol
  • 4
  • 3
8 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6223888
I think this link will help you:

http://www.jgsoftware.com/nt.htm
0
 
LVL 17

Expert Comment

by:geobul
ID: 6223899
Look for 'service applications-threads' in Delphi help. There is a sample with a thread and explanation.

Regards, Geo
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6223912
Thanks for the suggestions guys, but I really do want someone on here to give me a code sample and explain it to me.  I can't get that from a bunch of links.

Thanks again,

John.
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 100 total points
ID: 6224072
Ok, here we go

File menu > Close All
File menu > new > Service Application

Now you have a service that does absolutely nothing. It's like a normal Delphi project except that it has no forms (it uses TService instead of TForm). But you can still drop non-visual component in the 'Service1' window and use event etc. Beware that certain security restructions apply to services.
The rest is up to you.


To use (install) the service, type the following on the command line:

Project1 /install

(Don't forget to start the service)

And to uninstall

Project1 /uninstall
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Author Comment

by:Jaymol
ID: 6224081
Ta.  Just what I wanted.

John.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6224089
Why a C grade
0
 
LVL 6

Author Comment

by:Jaymol
ID: 6224094
Don't be greedy.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6224113
Hey, I am using MY time trying to solve YOUR problems. When I get a C-grade, I think that my comments where not good enough. Next to that I didn't even propose any of my comments a answer.

It just doen't look very gratefull to me.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now