我希望有人能指出我在下面遇到的打印问题的正确方向:
设置:Win CE 5.0 尝试从自定义应用程序打印。
我在我的应用程序中编写了一个非常简单的打印类,它使用 pcl 驱动程序并打印到 HP USB 打印机。在正常情况下打印方面很好,但我看不到处理错误情况的明显方法,例如打印机中没有纸等。
我正在做这样的事情(为清楚起见,删除了一般错误检查和其他细节):
// 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);
感谢您的任何帮助,您可以提供,
希尔帕