## Printer Device Driver

[prev][next][parent][TOC]

### AccessDevice

AccessDevice is the main function allowing access to a device. This access allows printing text files, querying device fonts, querying device caps, and querying device hardcopy caps.

Control Flow

1.Call GetQueueData(); to get driver data.
2.If printing from Presentation Manager, display the Confirm Print Information dialog box to verify queue, font, color, and text format options.
3.Call DevOpenDC(); to open the output device.
4.Query device or print to it based on input parameter "usActionType".
Possible Actions
ACTION_PRINT_FILE
Print text file from PM interface.
Call DevEscape( DEVESC_STARTDOC ).
Call PrintTextFile().
Call DevEscape( DEVESC_ENDDOC ).
ACTION_PRINT_FILE_NO_PM.
Print text file from an OS/2 command line.
Call DevEscape( DEVESC_STARTDOC ).
Call PrintTextFile().
Call DevEscape( DEVESC_ENDDOC ).
ACTION_QUERY_FONT
Call GpiQueryFonts().
Display the Font notebook page.
ACTION_QUERY_CAPS
Call DevQueryCaps().
Display Device Capabilities dialog box.
ACTION_QUERY_HCCAPS
Call DevQueryHardcopyCaps().
Display Device Form Information dialog box.
ACTION_QUERY_FORM_INFO
Call DevQueryHardcopyCaps().
Return index of HCCAPS_CURRENT form in HCINFO structure.
ACTION_QUERY_METRICS
Call GpiQueryFontmetrics(); for currently realized font. Display Current Font Metrics dialog box.
5.Call DevCloseDC(); to close device context.