Jump to content

wpSetJobProperties

From EDM2

This method is specific to Version 4, or higher, of the OS/2 operating system.

This instance method is called to set up the default job properties of the printer object.

Syntax

_wpSetJobProperties(self, pDrivData)

Parameters

self (WPPrinter *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPPrinter.
pDrivData (PDRIVDATA *) - input
Pointer to buffer containing **PDRIVDATA** (printer driver data) that this print object is to use.
If this is **NULL**, this print object will display the print driver job properties dialog.

Returns

rc (BOOL) - returns
Success indicator
  • TRUE Successful completion.
  • FALSE Error occurred.

How to Override

This method is generally not overridden.

Usage

This method can be called at any time in order to set the job properties of the printer object.

Example Code

#define INCL_WINWORKPLACE
#include <os2.h>

WPPrinter *self; /* Pointer to the object on which the method is being invoked. */
PDRIVDATA *pDrivData; /* Pointer to buffer containing PDRIVDATA (printer driver data) that this print object is to use. */
BOOL rc; /* Success indicator */

rc = _wpSetJobProperties(self, pDrivData);

Remarks

This method displays or sets the job properties for this print object. If **pDrivData** is supplied (not **NULL**), then this method will set the job properties for the print object referenced by **self**. If **pDrivData** is not supplied (is **NULL**), then this method will display the job properties dialog to the user and then set the print object to have the new job properties.

Example Code

This example creates a printer using default values and then sets the job properties of the newly created printer.

#include "wpprint.h"

WPPrinter *CreateAndSetPrintObject(WPPrinter *PrintObj)
{
  WPFolder *hwpFolder;

  hwpFolder = _wpclsQueryObjectFromPath(_WPFileSystem,
                                        (PSZ)"<WP_PRINTERSFOLDER>");
  if (!hwpFolder)
    return (PrintObj);

  if (!PrintObj)
    PrintObj = _wpclsNew(_WPPrinter,
                         "New Printer",
                         "",
                         hwpFolder,
                         TRUE);

  if (PrintObj)
    _wpSetJobProperties(PrintObj,
                         NULL);

  return (PrintObj);
}

Related Methods