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. Design issue with SDI app

Design issue with SDI app

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

    I am working on an SDI application with 3 different views(CFormView). There are 3-4 variables that are shared between those views. These variables should be saved in a file, so each time user starts the app its sees the interface as it was when he exited. I don't need to use CDocument, because I need just one file to store the settings for the app. Therefore, my questions are: 1) Where should I put those variables (CwinApp, CDocument or somewhere else)? 2) What other changes do I need to make, in order to have the app load the settings' file, when it starts, and save changes to the file when it exits? 3) How to 'turn off' support for creating new, opening and saving documents, since I don't need it? Any help would be appreciated.

    V A 2 Replies Last reply
    0
    • D dart13

      I am working on an SDI application with 3 different views(CFormView). There are 3-4 variables that are shared between those views. These variables should be saved in a file, so each time user starts the app its sees the interface as it was when he exited. I don't need to use CDocument, because I need just one file to store the settings for the app. Therefore, my questions are: 1) Where should I put those variables (CwinApp, CDocument or somewhere else)? 2) What other changes do I need to make, in order to have the app load the settings' file, when it starts, and save changes to the file when it exits? 3) How to 'turn off' support for creating new, opening and saving documents, since I don't need it? Any help would be appreciated.

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      Yes, I recommend CDocument. The concept of SDI utilizes CDocument. Access CDocument through the view. Kuphryn

      1 Reply Last reply
      0
      • D dart13

        I am working on an SDI application with 3 different views(CFormView). There are 3-4 variables that are shared between those views. These variables should be saved in a file, so each time user starts the app its sees the interface as it was when he exited. I don't need to use CDocument, because I need just one file to store the settings for the app. Therefore, my questions are: 1) Where should I put those variables (CwinApp, CDocument or somewhere else)? 2) What other changes do I need to make, in order to have the app load the settings' file, when it starts, and save changes to the file when it exits? 3) How to 'turn off' support for creating new, opening and saving documents, since I don't need it? Any help would be appreciated.

        A Offline
        A Offline
        Armin Fryder
        wrote on last edited by
        #3

        If you don´t necessarily need a file, what about the registry, otherwise you could use the applications´ ini file. 1) If the Views are using the same CDocument and you don´t need these variables anywhere else than in these view, you might as well put them in CDocumen, otherwise in CWinApp 2) The CWinApp object gives a halfway decent support to write an read from the ini file CWinApp::WriteProfileInt CWinApp::GetProfileInt CWinApp::GetProfileString CWinApp::GetProfileString... when the app quits, you can write your stuff within the virtual CWinApp::ExitInstance()... 3) Easiest thing to do is to throw out the resources directly from the menu.

        D 1 Reply Last reply
        0
        • A Armin Fryder

          If you don´t necessarily need a file, what about the registry, otherwise you could use the applications´ ini file. 1) If the Views are using the same CDocument and you don´t need these variables anywhere else than in these view, you might as well put them in CDocumen, otherwise in CWinApp 2) The CWinApp object gives a halfway decent support to write an read from the ini file CWinApp::WriteProfileInt CWinApp::GetProfileInt CWinApp::GetProfileString CWinApp::GetProfileString... when the app quits, you can write your stuff within the virtual CWinApp::ExitInstance()... 3) Easiest thing to do is to throw out the resources directly from the menu.

          D Offline
          D Offline
          dart13
          wrote on last edited by
          #4

          Thanks for your input. I'll probably opt for registry.

          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