Click here to Skip to main content
16,006,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generaltwo puzzling questions about MDI app Pin
ns5-Nov-02 2:24
ns5-Nov-02 2:24 
GeneralRe: two puzzling questions about MDI app Pin
Andreas Saurwein5-Nov-02 3:20
Andreas Saurwein5-Nov-02 3:20 
GeneralRe: two puzzling questions about MDI app Pin
ns5-Nov-02 3:32
ns5-Nov-02 3:32 
GeneralRe: two puzzling questions about MDI app Pin
Roger Allen5-Nov-02 3:21
Roger Allen5-Nov-02 3:21 
GeneralRe: two puzzling questions about MDI app Pin
ns5-Nov-02 3:35
ns5-Nov-02 3:35 
GeneralPrinting more than 1 page Pin
doctorpi5-Nov-02 1:27
doctorpi5-Nov-02 1:27 
GeneralRe: Printing more than 1 page Pin
Roger Allen5-Nov-02 1:55
Roger Allen5-Nov-02 1:55 
GeneralRe: Printing more than 1 page Pin
Steve S5-Nov-02 2:50
Steve S5-Nov-02 2:50 
Yes, I concur. I have written a series of applications which produce bills (mainly for solicitors, or for the non-UK reader, lawyers). As you might imagine, these can often (all too often) be multiple pages. Some of them are for claiming from the Legal Aid Board, so have a rigid format, while others are more free-form in content.

The way I do this is to generate a list of printing objects, each of which knows the page it is to be printed on (my base CPrintObject has a PageNum() member). I go through on OnPreparePrinting and generate this list, then the last object in the list has my final page number.

This can be used in SetMaxPage(), and then in OnPrint, I just go through the list and for each object where PageNum() == pInfo->m_nCurPage, I invoke the object's Print method.

This works fine, and allows you to honour page number selection from the print dialog and so on.

The only issue I found was that the preview looked terrible, presumably because the preview view was getting confused about the font selection/deselection that was taking place, so I output to a memory DC then blit the result, which tidied it up at the expense of taking longer.

Steve S
[This signature space available for rent]
GeneralProblems with accelerators and modeless dialogs! Pin
Daniel Strigl5-Nov-02 1:06
Daniel Strigl5-Nov-02 1:06 
GeneralRe: Problems with accelerators and modeless dialogs! Pin
dabs5-Nov-02 3:07
dabs5-Nov-02 3:07 
GeneralRe: Problems with accelerators and modeless dialogs! Pin
Daniel Strigl5-Nov-02 3:17
Daniel Strigl5-Nov-02 3:17 
QuestionTransparent Bitmap? Pin
Jawache5-Nov-02 1:00
Jawache5-Nov-02 1:00 
AnswerRe: Transparent Bitmap? Pin
jhwurmbach5-Nov-02 1:42
jhwurmbach5-Nov-02 1:42 
GeneralMSChart Pin
Ruca5-Nov-02 1:02
Ruca5-Nov-02 1:02 
Generalproblem with context menu in mdi Pin
fargo2k5-Nov-02 0:35
fargo2k5-Nov-02 0:35 
GeneralRe: problem with context menu in mdi Pin
Ravi Bhavnani5-Nov-02 0:54
professionalRavi Bhavnani5-Nov-02 0:54 
GeneralRe: problem with context menu in mdi Pin
fargo2k5-Nov-02 1:35
fargo2k5-Nov-02 1:35 
GeneralChange from decimal number to hex character Pin
ooosawaddee35-Nov-02 0:32
ooosawaddee35-Nov-02 0:32 
GeneralRe: Change from decimal number to hex character Pin
Anatari5-Nov-02 0:43
Anatari5-Nov-02 0:43 
GeneralRe: Change from decimal number to hex character Pin
Stephane Rodriguez.5-Nov-02 0:56
Stephane Rodriguez.5-Nov-02 0:56 
GeneralRe: Change from decimal number to hex character Pin
Gary R. Wheeler5-Nov-02 11:10
Gary R. Wheeler5-Nov-02 11:10 
GeneralRe: Change from decimal number to hex character Pin
Ravi Bhavnani5-Nov-02 0:57
professionalRavi Bhavnani5-Nov-02 0:57 
GeneralMIME types & application Pin
ov5-Nov-02 0:07
ov5-Nov-02 0:07 
GeneralRe: MIME types & application Pin
Stephane Rodriguez.5-Nov-02 0:21
Stephane Rodriguez.5-Nov-02 0:21 
GeneralRe: MIME types & application Pin
Anatari5-Nov-02 0:18
Anatari5-Nov-02 0:18 

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.