USB打印机开钱箱
type
TOutBufPassThrough = record // 用于USB接口打印机开钱箱
// 调用windows.extEscape可以直接用extEscape(handle, PASSTHROUGH, sizeOf(outBuf), @outBuf, 0, nil)向设备发送esc命令
nDataLen: word;
sEscData: array [0 .. 1024] of AnsiChar;
end;
procedure TFrmCollectionOrder.OpenUSBMoneyBox;
var
prt: TPrinter;
esc: TOutBufPassThrough;
sMoneyBoxOpenCommand: AnsiString;
begin
try
prt := Printers.Printer;
prt.beginDoc;
sMoneyBoxOpenCommand := AnsiString(const_OpenMoneyBoxCommand);
esc.nDataLen := Length(sMoneyBoxOpenCommand);
strpCopy(esc.sEscData, sMoneyBoxOpenCommand);
Windows.ExtEscape(prt.Handle, PASSTHROUGH, sizeOf(esc), @esc, 0, nil);
// PASSTHROUGH:允许程序直接发送数据到设备
prt.endDoc;
except
end;
end;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/archive/2013/01/05/2846443.html