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. doc/view

doc/view

Scheduled Pinned Locked Moved C / C++ / MFC
6 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.
  • K Offline
    K Offline
    kjessee
    wrote on last edited by
    #1

    I have an MDI program. One of the dialog boxes carries out some calculations and writes them to a file. I would like the program to open the file automatically. The file name will be known. The user defines it in the dialog box. Thanks I feel more like I do now than I did awhile ago.

    C 1 Reply Last reply
    0
    • K kjessee

      I have an MDI program. One of the dialog boxes carries out some calculations and writes them to a file. I would like the program to open the file automatically. The file name will be known. The user defines it in the dialog box. Thanks I feel more like I do now than I did awhile ago.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      This is a basic operation with iostreams - I have articles on CP, the MSDN has info also, as does google. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002

      K 1 Reply Last reply
      0
      • C Christian Graus

        This is a basic operation with iostreams - I have articles on CP, the MSDN has info also, as does google. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002

        K Offline
        K Offline
        kjessee
        wrote on last edited by
        #3

        The MDI program is a text editor. I would like the file to be visable as if the user had opened it with the file open dialog box. Is this still covered with IOstreams?

        C 1 Reply Last reply
        0
        • K kjessee

          The MDI program is a text editor. I would like the file to be visable as if the user had opened it with the file open dialog box. Is this still covered with IOstreams?

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Absolutely - an ifstream will read your file in no worries, and then you can just set up your editor to contain the data read in. something like std::ifstream a(szFilename); std::string s; while (getline(a, s)) MyInternalBuffer += s.c_str(); You need to include string and fstream for this to work. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002

          K 1 Reply Last reply
          0
          • C Christian Graus

            Absolutely - an ifstream will read your file in no worries, and then you can just set up your editor to contain the data read in. something like std::ifstream a(szFilename); std::string s; while (getline(a, s)) MyInternalBuffer += s.c_str(); You need to include string and fstream for this to work. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002

            K Offline
            K Offline
            kjessee
            wrote on last edited by
            #5

            How do I set up the editor to contain the data? that is where i am having problems. I have no problem reading the data into the buffer. I thought maybe I could CMyDoc* pdoc; pdoc.OpenFile( CString path ); I have searched my books on Doc/View architecture. I am sure the answer is there but I don't see it. Thank You

            C 1 Reply Last reply
            0
            • K kjessee

              How do I set up the editor to contain the data? that is where i am having problems. I have no problem reading the data into the buffer. I thought maybe I could CMyDoc* pdoc; pdoc.OpenFile( CString path ); I have searched my books on Doc/View architecture. I am sure the answer is there but I don't see it. Thank You

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              kjessee wrote: How do I set up the editor to contain the data? Oh - the problem is not loading, it's actually having the text in the editor ? There are many ways to go about this, the simplest is to use a CEditView ( from memory ) and call SetWindowText on it. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002

              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