[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Printing with RichEdit V2

Posted on 2000-05-17
8
Medium Priority
?
379 Views
Last Modified: 2013-12-03
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


 
0
Comment
Question by:Eyooper
[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
  • 4
  • 4
8 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 2818845
HOWTO: Use Built-In Printing Features from a Rich Edit Control
http://support.microsoft.com/support/kb/articles/Q129/8/60.asp
0
 

Author Comment

by:Eyooper
ID: 2819105
Been there, done that already.

Do you think I also need to use EM_DISPLAYBAND for V2, it should be optional.
 
Thanks
0
 
LVL 23

Expert Comment

by:chensu
ID: 2819195
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.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:Eyooper
ID: 2819232
Thats what I thought. Why does my print routine work ok using RichEdit V1? RICHED32.DLL

Thanks
0
 

Author Comment

by:Eyooper
ID: 2819980
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

0
 
LVL 23

Expert Comment

by:chensu
ID: 2820040
Try it with only one character to see what those numbers are. Then, you can probably figure out what is going on.
0
 

Author Comment

by:Eyooper
ID: 2820806
RichEdit V2 does not display the LF in it's control.

you can close the question.

Thanks
0
 
LVL 23

Accepted Solution

by:
chensu earned 150 total points
ID: 2822622
You may accept my comment as an answer or you may delete the question.

Thank you.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

656 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