The NTService control lets you 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. Specifically, you can configure it to start automatically after a system reboot -- a common requirement for a telephony server.
The control also provides functions for installing/uninstalling as a service, event logging, and registry management. The control is invisible at runtime.
Because Windows NT services normally runs without access to the desktop, you should ensure that the application does not require user input. You should detect all error conditions by placing On Error handlers in every event procedure.
Note: Be sure you can run VBVoice application normally before converting it into a NT service.
VBVoice automatically starts the Dialogic driver upon System Start, therefore no special action is necessary. You may set driver startup mode to Automatic, by selecting Dialogic System Startup Mode/Automatic. Note that Pronexus has seen some problems with this method.
To set up your application to run as a service:
Copy frmService.frm from the example Ezflow.vbp in the "..\Pronexus\VBVoice\netWorks\examples\NT Service" directory.
Add it to your application.
Make it the Startup form.
This form contains the main components required to run a service: the NTService control and a VB timer control.
Add the following code to your main VBVoice form to ensure that the application starts as soon as the form is loaded. Be sure to append a switch after StartSystem: False = no vbvlog, True = start vbvlog.
Sub Form_load()
VBVFrame1.StartSystem False
End Sub
When the NT Service Controller requests the application to start, the Start event will be fired. In this event, the timer is enabled. When the timer expires, the main VBVoice form is loaded and StartSystem is called from the forms Load event. A timer is then used to allow a fast response to the initial Start event, in order to avoid timeouts in the NT Service controller.
The code in the Form Load event is used to provide several command line options, including:
-debug |
Starts the service in debug mode. |
-normal |
Runs your VBVoice application normally, not as a service. |
-uninstall |
Un-installs your installed VBVoice service. |
anything else |
Provides a listing of options |
Dependencies |
The service is configured to start after the appropriate voice card driver has loaded using the Dependencies property. Two null characters (chr(0) ) indicate the end of the dependency string. This property is used when the Install method is called. |
Interactive |
The default is True, which allows the application to appear on the desktop after a user logs in. This is equivalent to the Allow Service to Interact with Desktop option in the Service dialog that appears after you click the Startup... button in the NT Services control panel applet. |
StartMode |
Set to 2, svcStartModeAutomatic. |
ServiceDisplayName |
Set to your service name. Name is displayed in the Control Panel. |
ServiceName |
Name used in the Registry. |
When running a VBVoice application as a service VBVLog.exe and the LineStatus control will either not work or error since the VBVoice service by default is run under the "Local System" Account and not the "Current" Account. To remedy this, assign a logon account to your VBVoice Service.
Your VBVoice Service can be configured to log on to special user accounts so that the user may have access to resources such as VBVLog.exe, VBVoice LineStatus control and other files and folders protected by Windows 2000.
Once you have created an NT Service using the Pronexus NT Service Control, follow these steps to assign a logon account:
Open your Control Panel \ Administrative Tools \ Services menu.
Find and open your service.
Select the Log On tab.
Select This Account.
Click Browse.
Select name of account, such as Administrator.
Click OK.
Set password and confirm.
Save and close.
Start service.
Now you will be able to open VBVLog.exe from your shortcut menu and run the LineStatus control to view all logging information.
For web browser integration you need a Web server, such as Microsoft Personal Web Server or IIS.
VBVCOM.DLL
VBVRLOG.EXE
VBV32.OCX
VBVPERF.DLL: Installed into system32, NT only.
VBVPERF.INI and GENCTRNM.H files for registration.
VBV_ADO.DLL
Copy the example htm files into a directory accessible from your web server. If a copy of Personal Web Server or IIS is found, the sample htm files will be copied to a new subdirectory netWorks, in the WWWROOT directory. In addition, shortcuts to all the files will be placed in the subdirectory HTM in the main install directory.
Use the standard redistribution packages for VBVoice and follow the instructions below for other components of VBVoice netWorks.
Installing VBVPERF.DLL:
Install into windows\system32
Un-register the old dll if replacing an existing copy
Register the new dll
Run LODCTR VBVPERF.INI to install counters. The VBVPERF.INI and GENCTRNM.H files are required in the directory from which LODCTR is run.
Register VBV_ADO.DLL
Copy the htm files into a directory accessible from your web server. The Personal Web Server can be downloaded from the Microsoft web site.