To create your ATL COM object so that it runs in a service, simply select Service (EXE) from the list of server options in the ATL Project Wizard. The wizard will then create a class derived from CAtlServiceModuleT to implement the service.
When the ATL COM object is built as a service, it will only be registered as a local server, and it will not appear in the list of services in Control Panel. This is because it is easier to debug the service as a local server than as a service. To install it as a service, run the following at the command prompt:
To uninstall it, run the following:
The first four topics in this section discuss the actions that occur during execution of CAtlServiceModuleT member functions. These topics appear in the same sequence as the functions are typically called. To improve your understanding of these topics, it is a good idea to use the source code generated by the ATL Project Wizard as a reference. These first four topics are:
The last three topics discuss concepts related to developing a service: