PrintingDevice.GetDevMode Method (Typed) |
Note: This API is now obsolete.
Namespace: XSharp.VO.SDK
1oPD is assumed to be a PrintingDevice object. 2LOCAL structDevMode AS _WINDEVMODE 3LOCAL i AS DWORD 4LOCAL cDeviceName AS STRING 5LOCAL cOrientation AS STRING 6structDevMode := oPD:GetDevMode() 7FOR i := 1 TO CCHDEVICENAME 8cDeviceName:=cDeviceName+Chr(structDevMode.dmDeviceName[i]) 9NEXT 10?"Device name is " 11??cDeviceName 12cOrientation := StringdmOrientation(structDevMode.dmOrientation) 13?"Orientation is " 14??cOrientation 15?"PaperLength is " 16??AllTrim(Str(structDevMode.dmPaperLength)) 17?"PaperWidth is " 18??AllTrim(Str(structDevMode.dmPaperWidth)) 19?"Number of copies is " 20??AllTrim(Str(structDevMode.dmCopies)) 21? "dmDefaultSource " 22?structDevMode.dmDefaultSource 23Wait 24FUNCTION StringdmOrientation(nO AS SHORTINT) AS STRING 25IF nO = DMORIENT_LANDSCAPE 26RETURN "Landscape" 27ELSEIF nO = DMORIENT_PORTRAIT 28RETURN "Portrait" 29ELSE 30RETURN "Unknown" 31ENDIF