?现在有一问题!当pos机中的打印机在打印时突然没纸,或者没电了!在程序中怎样给个警告!也就是说怎样在程序中给个处理!!有关源代码如下:(100分)

  • 主题发起人 netprobe
  • 开始时间
N

netprobe

Unregistered / Unconfirmed
GUEST, unregistred user!
是POS机中的打印机!
//打印机
TNarrowPrinter = class(TObject)
private
FOwner: TWinControl;
FOPOSPrinter: TOPOSPOSPrinter;
FOnDirectIOEvent: TOPOSPOSPrinterDirectIOEvent;
FOnErrorEvent: TOPOSPOSPrinterErrorEvent;
FOnOutputCompleteEvent: TOPOSPOSPrinterOutputCompleteEvent;
FOnStatusUpdateEvent: TOPOSPOSPrinterStatusUpdateEvent;
public
function PrintSegment(astr: string): Boolean;
constructor Create;
destructor Destroy; override;
procedure PrintSpaceline;
procedure PrintaLine;
function PrinteLine(astr: widestring): Boolean;
function PrinterStrings(aStrs: TStringList): Boolean;
function CutPaper: boolean;
function Printertest: boolean;
function SetAlignment(astr: string; pa: TPrintAlignment; aFont: Char):
string;
function SetFont(aFont: Char): string;
property OnDirectIOEvent: TOPOSPOSPrinterDirectIOEvent read FOnDirectIOEvent
write FOnDirectIOEvent;
property OnErrorEvent: TOPOSPOSPrinterErrorEvent read FOnErrorEvent write
FOnErrorEvent;
property OnOutputCompleteEvent: TOPOSPOSPrinterOutputCompleteEvent read
FOnOutputCompleteEvent write FOnOutputCompleteEvent;
property OnStatusUpdateEvent: TOPOSPOSPrinterStatusUpdateEvent read
FOnStatusUpdateEvent write FOnStatusUpdateEvent;
end;
 
顶部