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:
- Create a non-modal form as described in Creating a Custom Print Dialog.
- Add the DLL to the [USER_3GL] section of your assignment file.
-
Register a signature for the DLL in the Signature Editor.
- Obtain declarations for the DLL functions from the DLL's documentation.
- Make a corresponding Uniface signature for the DLL based on the DLL function declarations.
- Access DLL functions using activate statements in the print dialog.
-
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.
- Draw a drop-down list to select PrintMode.
-
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. - Return the user’s choices to the parent form. Process the information to provide PrintJobModel, PrintMode, and Settings information to the print statement.