How to use VB to compile NT service programs

Source: Internet
Author: User
I. NT service programs
The so-called NT service is actually a process that can automatically start with a certain identity when the system starts. Such as FTP server, HTTP server, and offline printing are provided in the form of NT services. This is actually similar to the Unix root daemon process. In summary, the NT service has the following features:
1. It can be started automatically without interactive startup. This is an important feature for servers. Of course, you can decide whether the service is self-started or even block a service.
2. The NT service has no user interface, which is basically similar to a DOS program. Because the NT service must run for a long time, you do not want to have your own interface like the common win32 process. However, the NT service can interact with the user interface, which is a special service process. You can view the service process through the task manager of NT.
3. The NT service is managed through the SCM interface. The SCM interface functions are required for installation, start, stop, and removal. The service controller of the control panel uses the SCM interface to manage all services in the system. In addition, there are some program commands that can control the service, such as 、SCM.exe, such as net.exe, Server Manager, and so on.
4. These processes run in a certain identity to facilitate access to server resources. Generally, the LocalSystem account in the domain is used to run the program. This account has full access permissions to most resources on the machine (unless otherwise prohibited), which ensures that the service program is "powerful ". However, some services run with special accounts. You can also set a service account.
5. The system automatically runs in the thread mode. Generally, it only occupies more system resources. This is different from common processes. If the thread mode is not used, generally, processes consume the entire CPU resource. Generally, tasks that need to exist from time to time and do not consume too much resources are most suitable for service implementation.
II. Service controls
C/C ++ is generally used to compile NT Services. VC6 uses the ATL wizard to provide a basic service framework. The specific implementation steps are: File à New... À atl com AppWizard à service à Finish. But using VC to compile NT services requires too much code, which also means too much debugging and maintenance. In fact, the NT service cannot be written only by C/C ++. In fact, it can be implemented by any language that can implement the features of the previous section, including VB.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.