1

以下で発生している印刷の問題について、誰かが正しい方向に向けてくれることを願っています。

セットアップ: 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);

ご協力いただきありがとうございます。

シルパ

4

1 に答える 1

1

プリンターの紙切れ、紙詰まり、またはその他の準備ができていない場合でも、DC は成功しますか?

印刷ジョブを開始すると、プリンターに問題が発生しても問題ありません。その時点で、OS はユーザーと対話し、問題があることをユーザーに知らせ、必要に応じてジョブを再開することになっています。

于 2012-08-06T18:42:29.233 に答える