This pair of projects create an application that is launched from a service.
The purpose of this example is to show how to monitor the application that is launched from the service. This is also the same process for monitoring an application launched by an application launched from a service.
This process is subtly different to the method for working with services (see the example service for that).
The service project is serviceWithAChildProcess.vcxproj
The following tasks are performed when the service is started:
•the test application is launched from the service
The application project is serviceChildProcess.vcxproj
The application's first task is to load Coverage Validator into the application.
•Loads the Coverage Validator stub DLL into the application
•Configures the NT Service API to communicate to Coverage Validator
•Does some work that can be monitored by Coverage Validator
•Exits
For implementation details see attachToCoverageValidator(); in serviceChildProcess.cpp.
The application will need to link to the NT Service API, for example ..\..\..\svlCVStubService\release_2010_x64\svlCVStubService_x64.lib (for a release x64 EXE/DLL).
Important. Call attachToCoverageValidator() as close to the start of your application as possible, before any threads have been created.
Read more about working with NT Services.