Create the Server
- Last UpdatedOct 30, 2024
- 2 minute read
This section describes the fundamentals and documents some tips that you can use while creating the in-process server using the batch function interface type libraries.
You can create the server with any COM-based programming environment. This includes Visual Basic.NET, C++, and C#.
Creating the server requires that you define each of the batch hook routines, and enable the routines that are to be used.
Important: All batch hooks must be included in the server logic, but not all are required to be enabled. Compilation errors are generated if you omit one or more batch hook routines.
If other batch databases are to be accessed from within a batch hook routine, it is recommended that all objects and applications are created and started during server initialization rather than at the time required in the routine. This minimizes the delay to return control to Batch Manager.
For an example of accessing batch databases within the batch function interface, refer to the Material Quantity Check at Batch Initialization example later in this section.
The COM-based batch function interface provides a very powerful mechanism for programmatically interacting with the execution of Batch Manager. However, errors in the server interface causes Batch Manager to shut down. Therefore, troubleshooting the in-process server is very important to the success of the interface. A very helpful tip for troubleshooting is to enable the Allow Service to Interact with Desktop option for the Batch Manager service. This permits message boxes and other graphical user interface controls to be used in the application for diagnostic purposes. Be sure to remove all message boxes from the application when properly defined. All such controls halt Batch Manager processing until they are acknowledged.