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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to write codes that load a text file?

How to write codes that load a text file?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestiontutorial
2 Posts 2 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.
  • L Offline
    L Offline
    leonwoo
    wrote on last edited by
    #1

    hi, I have written a MDI application that inherits CEditView for the view class. I wonder how can I load a text file without using the "Open File" dialogue box into the view. I have tried to insert the text line by line but it did not work because the application keeps printing at the same line in the view. It seems that there is a problem in generating new lines in the view. Any idea on how to solve the problem? I appreciate your help. Thanks. :confused: leonwoo

    L 1 Reply Last reply
    0
    • L leonwoo

      hi, I have written a MDI application that inherits CEditView for the view class. I wonder how can I load a text file without using the "Open File" dialogue box into the view. I have tried to insert the text line by line but it did not work because the application keeps printing at the same line in the view. It seems that there is a problem in generating new lines in the view. Any idea on how to solve the problem? I appreciate your help. Thanks. :confused: leonwoo

      L Offline
      L Offline
      l a u r e n
      wrote on last edited by
      #2

      CreateFile() ReadFile() CloseHandle() make sure you put cr\lf at the end of each line not just lf m_edit.SetWindowText(pData); :suss: --- "every year we invent better idiot proof systems and every year they invent better idiots"

      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