Introducing Automatic Start-Up as a Service

Production servers are only as reliable as the electrical sources that they are connected to. In the event of a power failure, it is essential for production PCs to restart automatically without having a user to log in the operating system first. This goes double when that production server is 50 miles away!

With VBVoice, depending on which programming language is being used (i.e. Visual Basic 6, or Visual Studio .Net 2003 Professional), different automatic startup options are offered when developing VBVoice applications.

Option 1: Visual Basic 6

Using the NTService Control with VBVoice (available after installing NetWorks)

The NTService control is an OCX that allows you to run your application as a Windows Service process. Once installed as a Service, your application may be configured and administered using the standard Windows configuration tools. In particular, it may be configured to be started automatically after every system reboot, a common requirement for a telephony server.

The control also provides functions for installing/un-installing as a service, event logging, and registry management. The control is invisible at runtime.

Steps

A detailed list of the properties of the NTService control can be found in the NetWorks help files.

NOTES:

  1. Because Windows services normally run without access to the desktop, ensure that the application does not require user input. You should detect all error conditions by placing On Error handlers in every event procedure.

  2. Ensure that you can run your VBVoice application normally before converting it into a NT service.

  3. Dialogic drivers: VBVoice automatically starts the Dialogic driver upon System Start, so no special action is necessary. You can set driver startup mode to Automatic, by selecting Dialogic System Startup Mode/ Automatic. Note that Pronexus has observed some problems with this method.

  4. Due to compatibility issues with the NTService control, Windows 2000, and ActiveX applications, Microsoft no longer officially supports the use of this control. Pronexus continues to include it for compatibility reasons, however the use of Windows Services is recommended for modern systems.

Option 2: Visual Studio .Net

Windows Services

This solution takes advantage of current Microsoft tools and methods for the creation of service type applications. As such a VBVoice application created as a Windows service using this method will have the same attributes as any other Windows application. Although the basic steps below outline the essentials in creating a VBVoice application as a Windows service, the methods used below are identical to those described in the Microsoft MSDN.

For detailed information on the creation of a service in .Net, please refer to the MSDN documentation installed with Visual Studio .Net.

Basic Steps:
  1. Create a new VB project, as type 'Windows Service' template.

  2. Once your project is create you will have to manually add a windows form and design your call flow.

  3. To start your project your will need to override the OnStart() function.

  4. You must run your VBVoice application on another thread separate from the windows service. Inside this new thread you start your application using Application.Run() command.

  5. To stop the application you will use the OnStop() method. The OnStop() method should stop VBVoice first then terminate the thread running the application.

Installation of Your Windows Service

(Using the installutil.exe installer)

  1. Start-> Programs-> Microsoft Visual Studio .NET -> Visual Studio .NET Tools-> Visual Studio .NET Command Prompt

  2. Change to the directory your compiled .exe file is located.

  3. Use the installutil.exe command to install your service (IE installutil vbvService.exe).

  4. To verify that your service is installed… Start-> Settings-> Control Panel-> Administrative Tools-> Services and look for your program.

NOTES:

  1. You will not be able to have your VBVFrame interact with the desktop, because Windows services are designed to run in the background.

  2. Currently the Windows Service Application project templates and functionality are not available in the Standard Edition of Visual Basic & C# .NET.