PASSTHROUGH

  #define PASSTHROUGH 19    

  short Control(lpDevice, PASSTHROUGH, lpInData, NULL)    
  LPPDEVICE lpDevice;    
  LPWORD lpInData;    

The PASSTHROUGH escape enables the application to send data directly to the printer, bypassing the standard printer-driver code.

Parameters

lpDevice

Points to a PDEVICE structure specifying the destination device.

lpInData

Points to a buffer in which the first 16 bits specifies the number of remaining bytes in the buffer. The escape sends the remaining bytes in the buffer to the printer.

Return Value

The return value is the number of bytes transferred to the printer if the escape is successful. Otherwise, the return value is zero if the escape is not successful, or if the escape is not implemented. If the return value is nonzero but less than the size of the data, an error prohibited transmission of the entire data block.

Comments

There may be restrictions on the kinds of device data an application may send to the device without interfering with the operation of the driver should not send commands that reset the printer or print the current page. Additionally, applications are strongly discouraged from performing functions that consume printer memory, such as downloading a font or a macro.

The driver should invalidate its internal state variables such as “current position” and “current line style” when carrying out this escape. The application must be able to issue multiple, sequential PASSTHROUGH escapes without intervening “saves” and “restores” being inserted by the driver.

This escape is also known as DEVICEDATA.