Printing formatted text

This is a discussion on Printing formatted text within the Windows Programming forums, part of the Platform Specific Boards category; Hi i'm building this simple text editor. It's a dialog based MFC app with a CRitchEdit control and i need ...

  1. #1
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    374

    Printing formatted text

    Hi i'm building this simple text editor. It's a dialog based MFC app with a CRitchEdit control and i need to print the formatted text in this CRitchEdit control. i know the basics of printing: you create a instance of CPrintDialog and get the printing info from the user, then you call StartDoc and StartPage functions etc. But i need to know how to print the text in the CRitchEdit control exactly as the way it is. Please help.
    Last edited by geek@02; 11-13-2006 at 06:52 AM.
    Some useless programs i've wrote : slprogrammersheaven
    Youtube: http://www.youtube.com/user/geekyzine
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amature english)

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    Printing is the same as doing a WM_PAINT but changing the DC to a CPrinterDC. Notice the paint message handler requires a CDC object. It just so happens that CPaintDC, CWindowDC, ClientDC, and CPrinterDC are all derived from CDC.

    So in short...you paint onto the printer which prints the document.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading a formatted text file
    By inspiro in forum C Programming
    Replies: 2
    Last Post: 06-25-2008, 07:39 PM
  2. printing a text file
    By j_spinto in forum C Programming
    Replies: 13
    Last Post: 06-25-2005, 05:33 PM
  3. scanf() formatted text...
    By Lynux-Penguin in forum C Programming
    Replies: 1
    Last Post: 07-23-2003, 02:11 PM
  4. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM
  5. formatted text from file.?
    By Gugge in forum C Programming
    Replies: 2
    Last Post: 03-08-2002, 04:25 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21