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. Sharing Data between object.

Sharing Data between object.

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

    what is best way to share data among classes? such as CView s & CDocument s ? what about use static data in stdfx.h? Best Regards. MJM.

    D T 2 Replies Last reply
    0
    • M mostafa_pasha

      what is best way to share data among classes? such as CView s & CDocument s ? what about use static data in stdfx.h? Best Regards. MJM.

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

      mostafa_pasha wrote:

      what is best way to share data among classes? such as CView s & CDocument s ?

      The document 'tells' the view that data needs to be rendered. The view 'asks' the document for the data that is to be rendered.

      mostafa_pasha wrote:

      what about use static data in stdfx.h?

      Why?


      "Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.

      "Judge not by the eye but by the heart." - Native American Proverb

      1 Reply Last reply
      0
      • M mostafa_pasha

        what is best way to share data among classes? such as CView s & CDocument s ? what about use static data in stdfx.h? Best Regards. MJM.

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        mostafa_pasha wrote:

        what is best way to share data among classes? such as CView s & CDocument s ? what about use static data in stdfx.h?

        there have inbuilt function for access CView from CDocument and Viceversa.. like GetDocument et

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

        M 1 Reply Last reply
        0
        • T ThatsAlok

          mostafa_pasha wrote:

          what is best way to share data among classes? such as CView s & CDocument s ? what about use static data in stdfx.h?

          there have inbuilt function for access CView from CDocument and Viceversa.. like GetDocument et

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

          M Offline
          M Offline
          mostafa_pasha
          wrote on last edited by
          #4

          Hi, thanks i know GetDocument every view belong to one document! if i wanna use data from two document & alter view what happen! 7 and how can i do that? i found for that i can use document template & for some data can share between all of my object i can declare in C...App the use throw my project with theApp.Data ! is that right?

          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