In addition to the keyboard and the screen, you define other devices for use by your DP4 application. As a minimum, if you wish to print from your application, you need to define a printer. All the information about the devices on a system is stored on the system database. Once you have defined the printers and devices used in your system, your application programs simply select the device that is to be used.
In DP4, an output device is defined in two parts:
This defines the device and all the possible control information that is required to operate it. For example, you may define all the useful commands that can be sent to a printer, including the commands to change to use the fonts available on a printer
This selects the parameters that you wish to use. For example, you may select the control string that chooses the Times Roman font (though this is unlikely to be necessary on a Windows based system).
Your DP4 application can select a specific output device by name, either in a program, or when the user runs a program. The selection includes any special parameters that are to be sent to the printer.
In the same way, you can access other devices such as a non standard display devices like customer and operator displays, scientific apparatus, bar code readers and magnetic stripe readers in your application. For some devices, you may need to provide a Device Interface (known as an OSDI). An OSDI consists of specialised code written in C. The DP4 OSDI pack ensures that device specific code is independent of your application programs. Your program can access an output device by name, and send the output in exactly the same way as if the device is a printer. Input devices are also specified by name, and the input is presented to the application in the same way as input from the keyboard.