NTService Client Sample

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

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 contains two Java-implemented clients that create an instance of the COM object served by the Microsoft® Windows NT® Service and invoke its ping method. Each method invocation counts the number of times the thread has been pinged, the Microsoft® Win32® thread ID of the thread hosting the COM object, and the Java thread information for the Java thread that is hosting the COM object. 

The CoCreateInstanceEx COM function allows the specification of security credentials and server name when creating an instance of a COM object. This means that no local registry information is required by the clients to create an instance of the DCOM object. As these clients only use the IDispatch interface for calling the COM object's method, there is no need for custom marshaling of interfaces, a proxy/stub DLL, or registration of a type library on the client computers.

One Java client is created as an AWT-signed applet that will work in any Internet Explorer browser with the appropriate version of the Microsoft virtual machine (Microsoft VM). The other client is a WFC implementation of a stand-alone client.

Key Project Files

AWTClient.java

A simple client application that uses only AWT components for creating the GUI, which is used to connect to the Java-implemented DCOM server.

ClientGUI.java

A simple client application that uses WFC components for creating the GUI, which is used to connect to the Java-implemented DCOM server.

Technologies Demonstrated

COM

This sample shows how to use:

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