Create a Service

To create your first Windows Service program, follow these steps:

Create a new target.

Add the pbniserv library for your PB version to the target's library list.

Set n_error to be the application's error object.

If you are using a database, set n_transaction to be the application's transaction object.

Add 'error.of_SystemError()' to the application's systemerror event.

Create a new userobject by inheriting from n_pbniserv.

Add code to the of_start, of_run and of_stop functions.

Install the service. (This is a onetime step in your development process)

Run the Service Control Manager.

Start the service.

If you want to make changes to your service, you must stop the service first. After you have saved the changes, then you can start the service again.