Click here to Skip to main content
15,891,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Specify items to step over when using F11 in VC Pin
vcplusplus2-Oct-03 10:44
vcplusplus2-Oct-03 10:44 
GeneralRe: Specify items to step over when using F11 in VC Pin
Grailman2-Oct-03 12:24
Grailman2-Oct-03 12:24 
GeneralRe: Specify items to step over when using F11 in VC Pin
vcplusplus2-Oct-03 14:24
vcplusplus2-Oct-03 14:24 
GeneralDetecting fastcall Pin
Gisle Vanem2-Oct-03 8:55
Gisle Vanem2-Oct-03 8:55 
Generaltab and space in CRichEditCtrl Pin
includeh102-Oct-03 7:49
includeh102-Oct-03 7:49 
GeneralRe: tab and space in CRichEditCtrl Pin
vcplusplus2-Oct-03 8:04
vcplusplus2-Oct-03 8:04 
GeneralRe: tab and space in CRichEditCtrl Pin
includeh102-Oct-03 9:20
includeh102-Oct-03 9:20 
GeneralYet Another Rich Edit Question Pin
Larry J. Siddens2-Oct-03 6:00
Larry J. Siddens2-Oct-03 6:00 
OK, here is what I want to do.


  1. Create a rich edit area on the screen. Using CScrollView as the canvas. I allow the creation of a CRichEditCtrl by dragging an area on the screen. I then use the screen coordinates and create the control.
  2. Setup the control so it emulates the printer in the word wrapping and font emulation. I use the SetTargetDevice with the width (in TWIPS)and a HDC to the printer. I calculate the width by getting a handle to the DC for the client window, setting the mapping mode to MM_TWIPS, and converting the display points from screen into TWIPs. Calculate the width and call SetTargetDevice.
  3. Print the contents of the CRichEditCtrl to a printer. I do this by using the same rectangle that I used to create the width for the SetTargetDevice in the FORMATRANGE structure. Fill in the rest and call FormatRange. (Three times, first with (null, false), second (format, true ), and the third (null,false).


Here is what I'm seeing. I draw a box around the control that is +5 screen units bigger (each direction) on the screen and printer. When I type text in the box then do a print preview/print, the characters to the right side of the box, the space seems to be smaller when I print it than when I displayed it. I think the printed version is using a different size font than what is on the display. What this should look like is a text box in word. As an example, create a text box in word, draw a line some where over it (like the middle). Notice what characters it intercets and print. The print output looks like the screen. I would like to do the same thing!

So: How do I create the control so it will appear on the screen as it will when I print?

Thanks

Once I get this beast whipped, all is well with the world. At least in my world! Big Grin | :-D

BTW, there is not much information on how to do this. Either on the MSDN or anywhere else.


Larry J. Siddens
Cornerstone Communications

TAME THE DOCUMENT MONSTER
www.unifier.biz
Generalregsvr32 sample debugging Pin
vancouver7772-Oct-03 5:55
vancouver7772-Oct-03 5:55 
GeneralRe: regsvr32 sample debugging Pin
sdfdsfa2-Oct-03 6:06
sdfdsfa2-Oct-03 6:06 
GeneralRe: regsvr32 sample debugging Pin
vancouver7772-Oct-03 7:11
vancouver7772-Oct-03 7:11 
GeneralRe: regsvr32 sample debugging Pin
igor19602-Oct-03 7:49
igor19602-Oct-03 7:49 
GeneralRe: regsvr32 sample debugging Pin
vancouver7772-Oct-03 10:32
vancouver7772-Oct-03 10:32 
GeneralRe: regsvr32 sample debugging Pin
sdfdsfa2-Oct-03 11:00
sdfdsfa2-Oct-03 11:00 
GeneralHelp in Generating Reports Pin
TheFox2-Oct-03 5:13
TheFox2-Oct-03 5:13 
GeneralRe: Help in Generating Reports Pin
G. Steudtel2-Oct-03 5:37
G. Steudtel2-Oct-03 5:37 
GeneralRe: Help in Generating Reports Pin
TheFox2-Oct-03 5:52
TheFox2-Oct-03 5:52 
GeneralRe: Help in Generating Reports Pin
G. Steudtel2-Oct-03 6:28
G. Steudtel2-Oct-03 6:28 
Generalbuttons requiring passwords Pin
PaulUK012-Oct-03 4:47
PaulUK012-Oct-03 4:47 
GeneralRe: buttons requiring passwords Pin
David Crow2-Oct-03 6:16
David Crow2-Oct-03 6:16 
GeneralRe: buttons requiring passwords Pin
Navin2-Oct-03 6:46
Navin2-Oct-03 6:46 
GeneralRe: buttons requiring passwords Pin
PaulUK012-Oct-03 7:36
PaulUK012-Oct-03 7:36 
GeneralClose a view during OnDraw Pin
CodeBrain2-Oct-03 4:06
CodeBrain2-Oct-03 4:06 
GeneralRe: Close a view during OnDraw Pin
Mike Dimmick2-Oct-03 4:12
Mike Dimmick2-Oct-03 4:12 
GeneralRe: Close a view during OnDraw Pin
CodeBrain3-Oct-03 0:36
CodeBrain3-Oct-03 0:36 

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.