Jump to content

PrtAbortDoc: Difference between revisions

From EDM2
Created page with "PrtAbortDoc resets the printer after current print data is flushed. If FLG_COMPLETE_DATA is set, all prior data for this job is sent to the printer. If this flag is clear, Prt..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
PrtAbortDoc resets the printer after current print data is flushed. If FLG_COMPLETE_DATA is set, all prior data for this job is sent to the printer. If this flag is clear, PrtAbortDoc first flushes all current write requests for this job and then sends the buffer of data to reset the printer.  
PrtAbortDoc resets the printer after current print data is flushed. If FLG_COMPLETE_DATA is set, all prior data for this job is sent to the printer. If this flag is clear, PrtAbortDoc first flushes all current write requests for this job and then sends the buffer of data to reset the printer.


==Syntax==
==Syntax==
  PrtAbortDoc(hDevice, pchData, cbData, ulFlags);
  PrtAbortDoc(hDevice, pchData, cbData, ulFlags)
 
==Parameters==
==Parameters==
; hDevice (HFILE) - input  
;hDevice (HFILE) - input: The device handle returned by PrtOpen.
: The device handle returned by PrtOpen.  
;pchData (PVOID) - input: Pointer to the data buffer to write after flushing all current write data.
 
;cbData (ULONG) - input: Length of data, in bytes, in pchData buffer.
; pchData (PVOID) - input  
;ulFlags (ULONG) - input: Abort processing flags.  
: Pointer to the data buffer to write after flushing all current write data.  
:Value is as follows:  
 
::FLG_COMPLETE_DATA - 0x00000001 - If this flag is set, all prior data for this job must be sent to the printer. If this flag is clear, any buffers waiting to be sent to the printer can be flushed.
; cbData (ULONG) - input  
: Length of data, in bytes, in pchData buffer.  
 
; ulFlags (ULONG) - input  
: Abort processing flags.  
 
Value is as follows:  
 
FLG_COMPLETE_DATA - 0x00000001  
If this flag is set, all prior data for this job must be sent to the printer. If this flag is clear, any buffers waiting to be sent to the printer can be flushed.  


==Return Code==
==Return Code==
; rc (ULONG) - returns  
;rc (ULONG) - returns: Return codes.
: Return codes.  
* 0 : Success
 
* 6 (ERROR_INVALID_HANDLE) : Invalid handle given.
* 0  
*29 (ERROR_WRITE_FAULT) : Failure attempting to write reset sequence to the device.
: Success  
*32 (ERROR_SHARING_VIOLATION) : Another thread has access to this port using this Prt handle. This can occur if another thread is in the middle of a PrtClose using this Prt handle.
 
* 6(ERROR_INVALID_HANDLE)  
: Invalid handle given.  
 
* 29(ERROR_WRITE_FAULT)  
: Failure attempting to write reset sequence to the device.  
 
* 32(ERROR_SHARING_VIOLATION)  
: Another thread has access to this port using this Prt handle. This can occur if another thread is in the middle of a PrtClose using this Prt handle.  


==Remarks==
==Remarks==
The return code must be checked to ensure that the reset sequence has been sent to the printer.  
The return code must be checked to ensure that the reset sequence has been sent to the printer.
 
PrtClose must still be issued to close the device connection.
==Example Code==
<PRE>
 
#define INCL_SPL
#define INCL_SPLDOSPRINT
#include <os2.h>
 
HFILE    hDevice;  /*  The device handle returned by PrtOpen. */
PVOID    pchData;  /*  Pointer to the data buffer to write after flushing all current write data. */
ULONG    cbData;  /*  Length of data, in bytes, in pchData buffer. */
ULONG    ulFlags;  /*  Abort processing flags. */
ULONG    rc;      /*  Return codes. */
 
rc = PrtAbortDoc(hDevice, pchData, cbData,
      ulFlags);


</PRE>
PrtClose must still be issued to close the device connection.


[[Category:Prt]]
[[Category:Prt]]

Revision as of 20:29, 30 May 2021

PrtAbortDoc resets the printer after current print data is flushed. If FLG_COMPLETE_DATA is set, all prior data for this job is sent to the printer. If this flag is clear, PrtAbortDoc first flushes all current write requests for this job and then sends the buffer of data to reset the printer.

Syntax

PrtAbortDoc(hDevice, pchData, cbData, ulFlags)

Parameters

hDevice (HFILE) - input
The device handle returned by PrtOpen.
pchData (PVOID) - input
Pointer to the data buffer to write after flushing all current write data.
cbData (ULONG) - input
Length of data, in bytes, in pchData buffer.
ulFlags (ULONG) - input
Abort processing flags.
Value is as follows:
FLG_COMPLETE_DATA - 0x00000001 - If this flag is set, all prior data for this job must be sent to the printer. If this flag is clear, any buffers waiting to be sent to the printer can be flushed.

Return Code

rc (ULONG) - returns
Return codes.
  • 0 : Success
  • 6 (ERROR_INVALID_HANDLE) : Invalid handle given.
  • 29 (ERROR_WRITE_FAULT) : Failure attempting to write reset sequence to the device.
  • 32 (ERROR_SHARING_VIOLATION) : Another thread has access to this port using this Prt handle. This can occur if another thread is in the middle of a PrtClose using this Prt handle.

Remarks

The return code must be checked to ensure that the reset sequence has been sent to the printer.

PrtClose must still be issued to close the device connection.