Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用StartDoc()/EndDoc()时,如何截获USB打印机错误消息?_C#_Windows Ce_Printer Control Language - Fatal编程技术网

C# 使用StartDoc()/EndDoc()时,如何截获USB打印机错误消息?

C# 使用StartDoc()/EndDoc()时,如何截获USB打印机错误消息?,c#,windows-ce,printer-control-language,C#,Windows Ce,Printer Control Language,我希望有人能为我指出正确的方向 以下是我遇到的打印问题: 设置: Win CE 5.0 正在尝试从自定义应用程序打印 我在我的应用程序中编写了一个非常简单的打印类 使用pcl驱动程序并打印到HP USB打印机。印刷术 相位在正常情况下是好的,但我看不到明显的变化 处理打印机无纸等错误情况的方法 我正在做类似的事情(一般错误检查和其他 为清晰起见,删除了详细信息): 谢谢你能提供的帮助 Shilpa即使打印机缺纸、卡纸或未准备好,您是否确定获得DC成功 一旦开始打印作业,如果打印机出现问题,这不是

我希望有人能为我指出正确的方向 以下是我遇到的打印问题:

设置: Win CE 5.0 正在尝试从自定义应用程序打印

我在我的应用程序中编写了一个非常简单的打印类 使用pcl驱动程序并打印到HP USB打印机。印刷术 相位在正常情况下是好的,但我看不到明显的变化 处理打印机无纸等错误情况的方法

我正在做类似的事情(一般错误检查和其他 为清晰起见,删除了详细信息):

谢谢你能提供的帮助


Shilpa

即使打印机缺纸、卡纸或未准备好,您是否确定获得DC成功


一旦开始打印作业,如果打印机出现问题,这不是您的问题。在这一点上,操作系统应该与用户交互,让他们知道有问题,必要时重新启动作业,等等

即使打印机缺纸、卡纸或未准备好,您确定get DC成功吗

一旦开始打印作业,如果打印机出现问题,这不是您的问题。在这一点上,操作系统应该与用户交互,让他们知道有问题,必要时重新启动作业,等等

// Get a DC to the printer. If printer isn't powered this will fail -
can print error stating "printer not found" or similar
hdcPrinter = CreateDC(@"pcl.dll", @"PCL Inkjet", @"LPT2:", ref mode);


// Signal the start of a document
StartDoc(hdcPrinter, &docInfo)
// Signal the start of a page
StartPage(hdcPrinter)

// Prepare the page to print/formatting etc

// Finished preparing the page
EndPage(hdcPrinter)

// This is the only page we are printing this time
EndDoc(hdcPrinter)

// Return the printer DC to the system as we are finished with it now.
DeleteDC(hdcPrinter);