Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CRichEditCtrl

CRichEditCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VinayCool
    wrote on last edited by
    #1

    Hi, Can anyone help with adding file contents to Rich Edit Box?? I have a text file i want to add the contents to rich Edit box,how to do that?

    S 1 Reply Last reply
    0
    • V VinayCool

      Hi, Can anyone help with adding file contents to Rich Edit Box?? I have a text file i want to add the contents to rich Edit box,how to do that?

      S Offline
      S Offline
      Sarath C
      wrote on last edited by
      #2

      Create control variable of type "CRichEditCtrl" you can set text using SetWindowText API. Make sure that AfxInitRichEdit(); called in your InitInstance function of the APP class. SaRath

      V 1 Reply Last reply
      0
      • S Sarath C

        Create control variable of type "CRichEditCtrl" you can set text using SetWindowText API. Make sure that AfxInitRichEdit(); called in your InitInstance function of the APP class. SaRath

        V Offline
        V Offline
        VinayCool
        wrote on last edited by
        #3

        Hi Sarath, Thanks for the reply. I have created m_FCONT of CRichEditCtrl, for reading the contents is this function enough ?? char ch; FILE *fp; fp=fopen(str,"r"); ch=getc(fp); while(!feof(fp)) { ch=getc(fp); }

        D 1 Reply Last reply
        0
        • V VinayCool

          Hi Sarath, Thanks for the reply. I have created m_FCONT of CRichEditCtrl, for reading the contents is this function enough ?? char ch; FILE *fp; fp=fopen(str,"r"); ch=getc(fp); while(!feof(fp)) { ch=getc(fp); }

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          vinaycool wrote:

          ch=getc(fp);

          Reading one character at a time is not very efficient. I suggest using CRichEditCtrl::StreamIn().


          "The largest fire starts but with the smallest spark." - David Crow

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups