Eyooper
asked on
Printing with RichEdit V2
I'm printing multi page documents using EM_FORMATRANGE and the first time through the loop the return value is too low and after that the return value is only incremented by two bytes and it prints nothing on page 2, 3, 4, ......
It's prints ok if I use RichEdit V1.
I'm using win98, NT 4.0, MASM.
Is there something wrong with RICHED20.DLL for printing?
Thanks
It's prints ok if I use RichEdit V1.
I'm using win98, NT 4.0, MASM.
Is there something wrong with RICHED20.DLL for printing?
Thanks
ASKER
Been there, done that already.
Do you think I also need to use EM_DISPLAYBAND for V2, it should be optional.
Thanks
Do you think I also need to use EM_DISPLAYBAND for V2, it should be optional.
Thanks
You don't have to use the EM_DISPLAYBAND message if you use a nonzero value for the wParam parameter in the EM_FORMATRANGE message.
ASKER
Thats what I thought. Why does my print routine work ok using RichEdit V1? RICHED32.DLL
Thanks
Thanks
ASKER
I sort of fixed the problem I was using WM_GETTEXTLENGTH to get the number of bytes to print which is the same as the file size. But the number of bytes in the edit control equals file size minus the number of lines, evidently it does not enclude either the CR or LF.
So if I do a EM_EXSETSEL with cpMin set to 0 and cpMax set to -1 and then do a EM_EXGETSEL and use the cpMax value to determin the number of bytes to print it prints ok.
I ran the same text with RichEdit V1 doing a EM_EXSETSEL, EM_EXGETSEL and the cpMax returned a value two bytes greater then the file size and WM_GETTEXTLENGTH.
If you can explain to me whats going on, you can have the points and close the question.
Thanks
So if I do a EM_EXSETSEL with cpMin set to 0 and cpMax set to -1 and then do a EM_EXGETSEL and use the cpMax value to determin the number of bytes to print it prints ok.
I ran the same text with RichEdit V1 doing a EM_EXSETSEL, EM_EXGETSEL and the cpMax returned a value two bytes greater then the file size and WM_GETTEXTLENGTH.
If you can explain to me whats going on, you can have the points and close the question.
Thanks
Try it with only one character to see what those numbers are. Then, you can probably figure out what is going on.
ASKER
RichEdit V2 does not display the LF in it's control.
you can close the question.
Thanks
you can close the question.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://support.microsoft.com/support/kb/articles/Q129/8/60.asp