Solved

SetAbortProc vs. AbortDoc

Posted on 2002-05-13
3
316 Views
Last Modified: 2010-05-18
I know the syntax of both of these functions but can't find any place in the MS literature where it states when one should be used over the other.

From what I've been able to discern with tests it appears as though I should I use SetAbortProc to handler print spooling errors and AbortDoc to handle user cancellation. Anyone know for sure?
0
Comment
Question by:tma050898
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 100 total points
ID: 7006296
Hi tma,

you should use AbortDoc if you want to programmatically cancel the print job
for any reason, i.e. if you provide the user with a print-progress dialog where
the user can press 'Cancel'. Calling AbortDoc in this case ensures that i.e.
not half of the document is printed when the user presses 'Cancel'.

The SetAbortProc should be used to handle the case printing was cancelled
by the OS, i.e. due to lack of memory, missing paper, broken connection
to the printer a.s.o. With this you can i.e. define a function which asks the
user to 'Retry' or to 'Cancel' the print job.

So, your statement '... I should I use SetAbortProc to handler print spooling errors
and AbortDoc to handle user cancellation' is absoluteley correct.

hope that helps,

ZOPPO
0
 
LVL 3

Author Comment

by:tma050898
ID: 7012690
Thanks for the confirmation!
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 7013184
You're welcome,

have a nice day,

regards,

ZOPPO
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Move constructor only called if marked noexcept? 6 104
thread-safe code in c++ 2 98
I could not build boost code, 10 87
Error C2678: binary '!=': no operator found... 4 47
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question