Thread: Printing formatted text

  1. #1
    Android geek@02's Avatar
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    470

    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 07:52 AM.
    GameJolt: https://gamejolt.com/@KasunL
    Game Development Youtube:
    https://is.gd/XyhYoP
    Amateur IT Blog: http://everything-geeky.blogspot.com/



    (and, sorry for my amateur English)

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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, 05:25 PM