Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
VCL
8-Byte Alignment
Action Classes
Additional Controls
Core VCL Classes
DFM to TEXT
Dialog Controls
Docking
Drag/Drop
Emulation Classes
Exceptions
Gestures
Graphics
MAPI Support
MDI Support
Multi-Monitor Support
OnGesture event
Printing
Property/Type Editors
Registry / INI Objects
Ribbon Controls
Sample Controls
Services
Standard Controls
Styles
System Controls
Thread support
Touch Controls
Type Info
Win 3.1 Controls
Win 32 Controls
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/VCL/Printing
[ Add a report in this area ]
Report #:
2965
Status:
Closed
Bug in Printers.pas - After aborting a job, next jobs not printable
Project:
Delphi
Build #:
6.163
Version:
10.0
Submitted By:
Oliver Kunz
Report Type:
Basic functionality failure
Date Reported:
11/21/2002 5:49:26 AM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All versions
Internal Tracking #:
235733
Resolution:
Need More Info
(Resolution Comments)
Resolved in Build:
:
10.0.2288.42451
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
4.00 out of 5
Total Votes:
None
Description
No documents will be printed anymore after a Printer.BeginDoc; ... Printer.Abort; - calling sequence.
Steps to Reproduce:
If you are printing with the functions
Printer.BeginDoc; <something2print> Printer.EndDoc; the printouts are correct.
If you have to abort a print job like
Printer.BeginDoc; <something2print> Printer.Abort; the printout is aborted - ok so far.
But if you then like to print something else with
Printer.BeginDoc; <something2print> Printer.EndDoc; these documents are not printed until you restart your application.
Workarounds
(->The COMMENTS-Section of the Quality Central Windows Client does not work)
If the document has been aborted in Windows with the AbortDoc()-function it seems that windows did not allow to use the DC again for next printouts, resp. all data sent to this DC will be discarded.
The workaround is to delete the DC after an abort, so for the next document to print, a new DC is generated automatically.
See the two changed functions of the unit Printers in the following:
procedure TPrinter.Abort;
begin
//CheckPrinting(True); obsolete: will be called in the EndDoc function below
//AbortDoc(Canvas.Handle); in this place the function always results with an
// SP_ERROR errcor code, because EndPage() was
// not called before
FAborted := True;
EndDoc;
end;
procedure TPrinter.EndDoc;
begin
CheckPrinting(True);
EndPage(DC);
if not Aborted then Windows.EndDoc(DC);
FPrinting := False;
if Aborted then begin //inserted
AbortDoc(DC); //inserted here AbortDoc is right
SetState(psNoHandle); //inserted now release DC
end; //inserted
FAborted := False;
FPageNumber := 0;
end;
Now it works fine.
---------
(->The COMMENTS-Section of the Quality Central Windows Client does not work)
If the document has been aborted in Windows with the AbortDoc()-function it seems that windows did not allow to use the DC again for next printouts, resp. all data sent to this DC will be discarded.
The workaround is to delete the DC after an abort, so for the next document to print, a new DC is generated automatically.
See the two changed functions of the unit Printers in the following:
procedure TPrinter.Abort;
begin
//CheckPrinting(True); obsolete: will be called in the EndDoc function below
//AbortDoc(Canvas.Handle); in this place the function always results with an
// SP_ERROR errcor code, because EndPage() was
// not called before
FAborted := True;
EndDoc;
end;
procedure TPrinter.EndDoc;
begin
CheckPrinting(True);
EndPage(DC);
if not Aborted then Windows.EndDoc(DC);
FPrinting := False;
if Aborted then begin //inserted
AbortDoc(DC); //inserted here AbortDoc is right
SetState(psNoHandle); //inserted now release DC
end; //inserted
FAborted := False;
FPageNumber := 0;
end;
Now it works fine.
---------
(->The COMMENTS-Section of the Quality Central Windows Client does not work)
If the document has been aborted in Windows with the AbortDoc()-function it seems that windows did not allow to use the DC again for next printouts, resp. all data sent to this DC will be discarded.
The workaround is to delete the DC after an abort, so for the next document to print, a new DC is generated automatically.
See the two changed functions of the unit Printers in the following:
procedure TPrinter.Abort;
begin
//CheckPrinting(True); obsolete: will be called in the EndDoc function below
//AbortDoc(Canvas.Handle); in this place the function always results with an
// SP_ERROR errcor code, because EndPage() was
// not called before
FAborted := True;
EndDoc;
end;
procedure TPrinter.EndDoc;
begin
CheckPrinting(True);
EndPage(DC);
if not Aborted then Windows.EndDoc(DC);
FPrinting := False;
if Aborted then begin //inserted
AbortDoc(DC); //inserted here AbortDoc is right
SetState(psNoHandle); //inserted now release DC
end; //inserted
FAborted := False;
FPageNumber := 0;
end;
Now it works fine.
Attachment
None
Comments
Rod Rishworth at 11/22/2002 12:20:05 AM
-
Two unprocessed workarounds yet I can comment...
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us