Click or drag to resize

PrintingDevice.UpdateDevMode Method

X#
Apply changes made to the DevMode structure to the associated device driver.

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD UpdateDevMode() AS USUAL
Request Example View Source

Return Value

Type: Usual
A logic indicating the success of the update.
Remarks
UpdateDevMode() copies the information in the PrintingDevice objects DevMode structure to the printer driver. Access to the structure is provide via the PrintingDevice:GetDevMode() method. You must first use this method to obtain a pointer to the structure. This structure resides in the underlying PrintingDevice object.
Examples
This example changes the orientation to landscape and sets the number of copies to be printed to10.
X#
 1oPD is assumed to be a PrintingDevice object.
 2LOCAL structDevMode    AS _WINDEVMODE    // AS allocates memory for
 3// the pointer not the structure
 4structDevMode := oPD:GetDevMode()    // map printing devices devmode
 5// structure
 6structDevMode.dmCopies    := 10
 7structDevMode.dmOrientation    := DMORIENT_PORTRAIT
 8lSuccess := oPD:UpdateDevMode()
 9IF !lSuccess
10? "Error updating devmode"
11ELSE
12? "devmode updated successfully"
13ENDIF
14InKey(0)
15// destroy printer object (reclaim GDI resources)
16oP:Destroy()
17FUNCTION ShowValue(uValue)
18IF IsArray(uValue)
19AEval(uValue, {|u| ShowValue(u)})    // recurse until
20// single element found
21ELSEIF IsNumeric(uValue) .AND. uValue = CAPABILITY_NOT_AVAIALBLE
22QOut("Device capability not available from driver")
23ELSE
24QOut(uValue)
25ENDIF
See Also