Click here to Skip to main content
16,011,804 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: help! perhaps u can spot this... Pin
Shaun Wilde19-Nov-02 22:38
Shaun Wilde19-Nov-02 22:38 
GeneralRe: help! perhaps u can spot this... Pin
devvvy19-Nov-02 22:46
devvvy19-Nov-02 22:46 
GeneralRe: help! perhaps u can spot this... Pin
devvvy19-Nov-02 22:49
devvvy19-Nov-02 22:49 
GeneralRTF Formatting & preview Pin
Steve S19-Nov-02 22:06
Steve S19-Nov-02 22:06 
GeneralRe: RTF Formatting & preview Pin
Miguel Lopes20-Nov-02 4:51
Miguel Lopes20-Nov-02 4:51 
GeneralRe: RTF Formatting & preview Pin
Steve S20-Nov-02 5:04
Steve S20-Nov-02 5:04 
GeneralRe: RTF Formatting & preview Pin
Gary R. Wheeler20-Nov-02 14:02
Gary R. Wheeler20-Nov-02 14:02 
GeneralRe: RTF Formatting & preview Pin
Steve S20-Nov-02 21:52
Steve S20-Nov-02 21:52 
Yes, me too, been there, done that, bought the T-shirt...
I learned from experience that a more reliable way when using MFC without wanting to break absolutely everything was;

In OnPrint, check if we're previewing; if so, create a printer-page sized bitmap, and a memory dc with it selected, and use this for output (I do this by having a RealPrint(CDC*, CPrintInfo*) function which does only the output), otherwise used the passed dc for RealPrint.

On return from that, if we're previewing, blit the memory dc to the passed dc, then cleanup.

Gives much better results, IME.

My problem is subtly different, in that it would consistently not print the last line, and since the measuring & rendering was being done by a control, I didn't really want to have to write an RTF interpretation and layout engine.

However, thanks to Miguel, who put me on the right track. It turned out that I was clearing the control's cache using FormatRange(NULL,FALSE) in between calls to the real FormatRange(), so I was getting inconsistent numbers back.
Now fixed.


Steve S
[This signature space available for rent]
GeneralMaximize box Pin
suresh_sathya19-Nov-02 21:34
suresh_sathya19-Nov-02 21:34 
GeneralRe: Maximize box Pin
Paul M Watt19-Nov-02 22:15
mentorPaul M Watt19-Nov-02 22:15 
GeneralRe: Maximize box Pin
suresh_sathya19-Nov-02 22:22
suresh_sathya19-Nov-02 22:22 
GeneralWindow with multipe pages Pin
Luke Murray19-Nov-02 20:59
Luke Murray19-Nov-02 20:59 
GeneralRe: Window with multipe pages Pin
dima_t20-Nov-02 23:45
dima_t20-Nov-02 23:45 
Questioncan u use HRESULT_CODE in VC's tool "Error Lookup"? Pin
devvvy19-Nov-02 20:57
devvvy19-Nov-02 20:57 
AnswerRe: can u use HRESULT_CODE in VC's tool "Error Lookup"? Pin
Gary R. Wheeler20-Nov-02 14:08
Gary R. Wheeler20-Nov-02 14:08 
Generalexception for ADO recordset open method Pin
devvvy19-Nov-02 18:37
devvvy19-Nov-02 18:37 
GeneralRe: exception for ADO recordset open method Pin
Christian Graus19-Nov-02 19:39
protectorChristian Graus19-Nov-02 19:39 
GeneralRe: exception for ADO recordset open method Pin
devvvy19-Nov-02 19:44
devvvy19-Nov-02 19:44 
GeneralRe: exception for ADO recordset open method Pin
Christian Graus19-Nov-02 19:48
protectorChristian Graus19-Nov-02 19:48 
GeneralRe: exception for ADO recordset open method Pin
devvvy19-Nov-02 20:06
devvvy19-Nov-02 20:06 
GeneralRe: exception for ADO recordset open method Pin
devvvy19-Nov-02 20:07
devvvy19-Nov-02 20:07 
Questionhow can u enumerate tables given a database? Pin
devvvy19-Nov-02 17:12
devvvy19-Nov-02 17:12 
AnswerRe: how can u enumerate tables given a database? Pin
Christian Graus19-Nov-02 17:22
protectorChristian Graus19-Nov-02 17:22 
GeneralRe: how can u enumerate tables given a database? Pin
devvvy19-Nov-02 17:34
devvvy19-Nov-02 17:34 
GeneralRe: how can u enumerate tables given a database? Pin
Christian Graus19-Nov-02 17:47
protectorChristian Graus19-Nov-02 17:47 

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.