Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Printer is not currently printing



Permlink Replies: 4 - Last Post: Aug 18, 2016 10:09 AM Last Post By: Remy Lebeau (Te...
Fred Fonar

Posts: 137
Registered: 3/16/00
Printer is not currently printing
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 17, 2016 6:06 PM
I have code that used to work but now I've got error "Printer is not currently printing" immediately after AssignPrn(f) and Rewrite(f) followed by WriteLn(f, ...). I have no clue how to fix it. Please help.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Printer is not currently printing
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 17, 2016 7:10 PM   in response to: Fred Fonar in response to: Fred Fonar
Fred wrote:

I have code that used to work but now I've got error "Printer is not
currently printing" immediately after AssignPrn(f) and Rewrite(f)
followed by WriteLn(f, ...). I have no clue how to fix it. Please
help.

AssignPrn() is just a wrapper for using TPrinter with old-style TextFile I/O.

Have a look at this recent discussion on StackOverflow related to TPrinter
breakage caused by a recent Microsoft security update:

Why is TPrinter (XE7) suddenly having problems today?
http://stackoverflow.com/questions/38904160/

Also see:

Apps created with Delphi XE5 print errors with Windows 10 update
http://community.embarcadero.com/answers/apps-created-with-delphi-xe5-print-errors-with-windows-10-update

--
Remy Lebeau (TeamB)
Fred Fonar

Posts: 137
Registered: 3/16/00
Re: Printer is not currently printing
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 18, 2016 9:20 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Fred wrote:

I have code that used to work but now I've got error "Printer is not
currently printing" immediately after AssignPrn(f) and Rewrite(f)
followed by WriteLn(f, ...). I have no clue how to fix it. Please
help.

AssignPrn() is just a wrapper for using TPrinter with old-style TextFile I/O.

Have a look at this recent discussion on StackOverflow related to TPrinter
breakage caused by a recent Microsoft security update:

Why is TPrinter (XE7) suddenly having problems today?
http://stackoverflow.com/questions/38904160/

Also see:

Apps created with Delphi XE5 print errors with Windows 10 update
http://community.embarcadero.com/answers/apps-created-with-delphi-xe5-print-errors-with-windows-10-update

--
Remy Lebeau (TeamB)

Thanks, Remy

I tried called Printer.PrinterIndex := 0 before AssignPrn but still got error. I cannot release handle as program failed on 3rd attempt (first two - successfully printed). I don't want to mass around with Microsoft windows update. What should I do solve the issue? BTW Project compiled with Delphi 6 compiled on Windows XP has no problem (the same code). I have problems using Delphi 10 on Windows 10.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Printer is not currently printing
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 18, 2016 10:09 AM   in response to: Fred Fonar in response to: Fred Fonar
Fred wrote:

I tried called Printer.PrinterIndex := 0 before AssignPrn but still
got error.

Was the PrinterIndex already 0 to begin with? Assigning the same value has
no effect. You have to set it to a different value, or to -1 to select the
default printer.

--
Remy Lebeau (TeamB)
Fred Fonar

Posts: 137
Registered: 3/16/00
Re: Printer is not currently printing
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 18, 2016 9:51 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Fred wrote:

I have code that used to work but now I've got error "Printer is not
currently printing" immediately after AssignPrn(f) and Rewrite(f)
followed by WriteLn(f, ...). I have no clue how to fix it. Please
help.

AssignPrn() is just a wrapper for using TPrinter with old-style TextFile I/O.

Have a look at this recent discussion on StackOverflow related to TPrinter
breakage caused by a recent Microsoft security update:

Why is TPrinter (XE7) suddenly having problems today?
http://stackoverflow.com/questions/38904160/

Also see:

Apps created with Delphi XE5 print errors with Windows 10 update
http://community.embarcadero.com/answers/apps-created-with-delphi-xe5-print-errors-with-windows-10-update

--
Remy Lebeau (TeamB)

I've got solution. I call Vcl.Printers.SetPrinter(TPrinter.Create).Free before AssignPrn

Thanks, Remy
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02