Click here to Skip to main content
15,911,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalset max size of program Pin
jafrazee13-May-02 3:47
jafrazee13-May-02 3:47 
GeneralRe: set max size of program Pin
Alexandru Savescu13-May-02 3:58
Alexandru Savescu13-May-02 3:58 
GeneralRe: set max size of program Pin
Prem Kumar13-May-02 4:01
Prem Kumar13-May-02 4:01 
GeneralRe: set max size of program Pin
Prem Kumar13-May-02 3:53
Prem Kumar13-May-02 3:53 
GeneralRe: set max size of program Pin
Magnus Westin13-May-02 4:06
Magnus Westin13-May-02 4:06 
GeneralRe: set max size of program Pin
Paul M Watt13-May-02 5:33
mentorPaul M Watt13-May-02 5:33 
GeneralSetAbortProc vs. AbortDoc Pin
Tom Archer13-May-02 3:35
Tom Archer13-May-02 3:35 
GeneralRe: SetAbortProc vs. AbortDoc Pin
Jonathan Craig13-May-02 11:47
Jonathan Craig13-May-02 11:47 
You are the author of two books and are asking us for help? Will I get royalties if I answer your question? We should be emailing you with questions...

The AbortDoc method and the abort proc function are two different things. If you look at the CView::OnFilePrint() method in the MFC you can see how both are used. The SetAbortProc method is use by the print manager to set a call back function. This call back (abort proc) gets called to check if the use wants to cancel (abort) the print. If the use does then the AbortDoc method is called.

For standard MFC printing OnFilePrint method will call the abort proc between printing each page. This _AfxAbortProc(HDC, int) function will check and see if the cancel button has been pressed.

Why use SetAbortProc? The default print stuff works well for most multipage printing. But, what if your print is only one page long and takes a long time to render to the printer? You may what to create your own OnFilePrint and abort proc that will allow the user to cancel the print. Creating you own also allows you to use a custom dialog during printing. Say, one that shows the precentage complete instead of the page being printed.

Note that the abort proc also get called for internal printing errors and out-of-memory or out-of-disk conditions.

See MSDN for:

Callback Function for CDC::SetAbortProc
CDC::SetAbortProc

and MFC source Viewprnt.cpp:

CView::OnFilePrint()
class CPrintingDialog : public CDialog
BOOL CALLBACK _AfxAbortProc(HDC, int)

Hope this helps...Smile | :)

Good luck with the books!

Jonathan Craig
www.mcw-tech.com
GeneralHelp on VC++ Pin
13-May-02 0:53
suss13-May-02 0:53 
GeneralRe: Help on VC++ Pin
Nish Nishant13-May-02 1:03
sitebuilderNish Nishant13-May-02 1:03 
GeneralRe: Help on VC++ Pin
13-May-02 1:16
suss13-May-02 1:16 
GeneralRe: Help on VC++ Pin
13-May-02 1:11
suss13-May-02 1:11 
GeneralRe: Help on VC++ Pin
Nish Nishant13-May-02 1:20
sitebuilderNish Nishant13-May-02 1:20 
GeneralRe: Help on VC++ Pin
Michael P Butler13-May-02 1:20
Michael P Butler13-May-02 1:20 
GeneralRe: Help on VC++ Pin
13-May-02 1:16
suss13-May-02 1:16 
GeneralRe: Help on VC++ Pin
13-May-02 1:44
suss13-May-02 1:44 
GeneralRe: Help on VC++ Pin
Michael P Butler13-May-02 2:25
Michael P Butler13-May-02 2:25 
GeneralRe: Help on VC++ Pin
Bill Wilson13-May-02 10:06
Bill Wilson13-May-02 10:06 
GeneralRe: Help on VC++ Pin
Bill Wilson13-May-02 10:06
Bill Wilson13-May-02 10:06 
GeneralRe: Help on VC++ Pin
DarkL_Phoenix14-May-02 4:10
DarkL_Phoenix14-May-02 4:10 
GeneralMSVCRT crash on exit! Pin
13-May-02 0:49
suss13-May-02 0:49 
GeneralRe: MSVCRT crash on exit! Pin
Le centriste13-May-02 8:36
Le centriste13-May-02 8:36 
GeneralMmtask crash on exit. Pin
13-May-02 0:45
suss13-May-02 0:45 
GeneralSecure my Folder Pin
Sameer Maggon13-May-02 0:28
Sameer Maggon13-May-02 0:28 
GeneralGetting mutex process Pin
confalonieri13-May-02 0:29
confalonieri13-May-02 0:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.