?
Solved

SetAbortProc vs. AbortDoc

Posted on 2002-05-13
3
Medium Priority
?
355 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 400 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

770 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