This example demonstrates how to create an NT service that contains a CORBA
server. Please note that this demo needs JThreads/C++ to run.

To run the demo, do the following:

- Install the service:

    server --install

- Select the Control Panel -> Services -> Hello World Service -> Start.

- Next run the client:

    client

- Enter `h' a few times. If you don't get a COMM_FAILURE exception,
  then the service is running.

- Exit the client by entering `x'.

- Select the Control Panel -> Services -> Hello World Service -> Stop.

- Uninstall the service with:

    server --uninstall

You can view trace messages from the service in the NT event viewer.

HOW-TO
------

To create a CORBA server that runs as an NT service the following steps
must be completed:

- Provide code to install/uninstall and run the service. Typically this
  will be similar to the code in Server.cpp.

- Implement a sub-class of OBNTService. An implementation must be provided
  for start() and stop().

  - The implementation for start() should provide all initialization steps
    necessary to start your CORBA server. This would typically
    involve initializing the ORB/BOA, creating necessary servants,
    and calling boa -> impl_is_ready. Before impl_is_ready is called
    statusUpdate(SERVICE_RUNNING) must be called to inform the NT service
    manager that the service is available.

  - The implementation of stop() should shutdown the service. Typically
    this should be done by calling boa -> deactivate_impl.

  - The constructor of OBNTService optionally takes a DWORD event-id. If
    this DWORD is present all event messages will go into the NT event
    logger. To avoid nasty messages in the event logger you should
    produce a message file similar to the one contained in this demo.
    Note that mc and rc must be run on the message file, and the resulting
    .res file must be linked into the final application. For example,

    mc HelloMsg.mc
    rc -r -fo HelloMsg.res HelloMsg.rc

    The user application then includes HelloMsg.h, and uses the HELLO_MSG
    DWORD as a parameter to the constructor.

ORBacus also restricts NT service apps to the threaded concurrency models.

There are several restrictions that must be noted when developing an
NT service.

- The service cannot access network disks.
- The service cannot access user environment variables.
- The service does not have access to HKEY_CURRENT_USER registry variables.

The reader is encouraged to browse the WIN32 SDK documentation on the NT
service manager.
