Use Third-Party DLLs in a Custom Print Dialog

You can extend the custom print dialog box to use a third-party DLL to change Microsoft Windows printer settings.

To use external DLLs:

  1. Create a non-modal form as described in Creating a Custom Print Dialog.
  2. Add the DLL to the [USER_3GL] section of your assignment file.
  3. Register a signature for the DLL in the Signature Editor.
    1. Obtain declarations for the DLL functions from the DLL's documentation.
    2. Make a corresponding Uniface signature for the DLL based on the DLL function declarations.
  4. Access DLL functions using activate statements in the print dialog.
  5. Draw a drop-down list of available print job models, using a ValRep in the format of PrintJobModel=DescriptiveText.

    Note:  A print job model is still required by Uniface, even if printer settings are handled by third-party printing software.

  6. Draw a drop-down list to select PrintMode.
  7. In the print instruction, set USE_SYSTEM_SETTINGS=TRUE. This prevents the print job model overriding the Microsoft Windows printer settings made by the third-party DLL.
  8. Return the user’s choices to the parent form. Process the information to provide PrintJobModel, PrintMode, and Settings information to the print statement.