?
Solved

NT Service ?

Posted on 2000-02-10
3
Medium Priority
?
189 Views
Last Modified: 2010-05-02
How do i write a program that runs as a Windows NT service ?

Basically i want to achieve this :
I want to invoke a carry out a certain activity (liking invoking a certain application) based on time. That is, i schedule some activities for some time in future. Now, my appln. should continuosly check for time and if it is time to carry out that activity, simply do that, and continue running.

I guess, i must write a program that runs in background as a NT service.

How do i do this ?
Any code or info. on where i can find help on this would be helpful.

Thx.
0
Comment
Question by:Jitu
3 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 2507021
An NT service is simply an executable that has been configured as a service.

However if you are particularly interested in carrying out specfic activities based on time then you are much better off when running under NT using the scheduler service which is already available as standard. This allows you to use the AT command to schedule activity at a specific time.

If you have the NT resource kit, there is also a utility called WINAT which provides a graphical interface to the scheduler rather than a CMD prompt interface. The resource kit also includes some information on installing executables as NT services and some considerations regarding such applications in that an NT service cannot have both a user interface AND network access at the same time unless certain additional configuration changes are made to the network.

0
 
LVL 3

Accepted Solution

by:
MTroutwine earned 50 total points
ID: 2507673
Microsoft already has an ActiveX control that can be used to create an NT Service.  Here is the URL for the files (it includes a sample application) and the VB code to implement it!

http://msdn.microsoft.com/library/techart/msdn_ntsrvocx.htm

:>)
0
 
LVL 18

Expert Comment

by:mdougan
ID: 2711980
Bought this question.

I'd already downloaded the sample listed in the answer.  It's just the C source code, and you have to recompile it.  I did this, but ran into several errors because the example was written in 1996, and the version of Visual C compiler they used was outdated.  After some trials, I got it to compile, but never got it to load into VB 6......
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

594 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