NTService Server Sample

This sample is located in \Samples\Com\NTService\Sample\Server.

Note   To use this sample, it is recommended that you have Microsoft® Visual C++® version 5.0 or higher installed.

Description
Key Project Files
Technologies Demonstrated

Description

This sample uses the generic Microsoft® Windows NT® Service code (..\Sample\NTService) and the generic COM server classes (..\Sample\Dcom) to implement a COM server that serves a Java/COM singleton hosted in a single-threaded apartment. By writing this COM server as an NT Service, it can be automatically started when Windows NT loads, and be controlled through the Service Manager applet in Control Panel.

Key Project Files

DCOMService.java

This class serves as the main method for registering the NTService, eventlog message information, and the appropriate registry settings for the COM Server to run as a Windows NT Service.

Pinger.java

This class is a simple COM object that will be served. As it does not implement any custom interfaces, it is interacted with through its IDispatch interface, provided by the Microsoft virtual machine's COM-Callable Wrapper (CCW).

TestService.java

The implementation of the jntsvc version of the client, which is created using the com.ms.service classes and the jntsvc tool.

Technologies Demonstrated

Windows NT Service

This sample shows how to:

© 1999 Microsoft Corporation. All rights reserved. Terms of use.