Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Windows printer unavailable - app hangs

$
0
0

Hello.

This is how I do the printing in my winforms application.

Lots of documents get printed every day cca 200 docs with 50 lines.

But sometimes it happens that printer is not available and application hangs... every month 2 times cca.

Should I be doing printDoc.Dispose() on the end?

Is it possible that the printer is unavailable because I dont dispose?

System.Drawing.Printing.PrintDocument printDoc = new System.Drawing.Printing.PrintDocument();

            printDoc.BeginPrint += new System.Drawing.Printing.PrintEventHandler(OnBeginPrint);
            printDoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(OnPrintPage);


            rtbLines.AppendText("Something to print");

            printDoc.Print();


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>