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. How to Access CStringArray object from one class to other

How to Access CStringArray object from one class to other

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
5 Posts 5 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.
  • A Offline
    A Offline
    Atul23
    wrote on last edited by
    #1

    Hi ALL, I am using property page in my project. In Property page class i used pagePAth object of CStringArray class. I store paths in pagePath object. Now I want to retreive paths by using pagePAth object in CMyView class which is derived from CView class. I am unable to acces pahePAth object in CMyView class. Please send me solution if u have. Thanks in Advance am

    hi

    C D K B 4 Replies Last reply
    0
    • A Atul23

      Hi ALL, I am using property page in my project. In Property page class i used pagePAth object of CStringArray class. I store paths in pagePath object. Now I want to retreive paths by using pagePAth object in CMyView class which is derived from CView class. I am unable to acces pahePAth object in CMyView class. Please send me solution if u have. Thanks in Advance am

      hi

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      You may: (1) declare it public. (2) make a public accessor method to it. (3) change is scope (relocate it and make it available to both classes). (4) ... :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      1 Reply Last reply
      0
      • A Atul23

        Hi ALL, I am using property page in my project. In Property page class i used pagePAth object of CStringArray class. I store paths in pagePath object. Now I want to retreive paths by using pagePAth object in CMyView class which is derived from CView class. I am unable to acces pahePAth object in CMyView class. Please send me solution if u have. Thanks in Advance am

        hi

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

        Does CMyView own (i.e., bring up) the property sheet? If so, make pagePAth a member of CMyView. Then when you construct the property sheet, pass it a pointer to pagePAth.

        "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        1 Reply Last reply
        0
        • A Atul23

          Hi ALL, I am using property page in my project. In Property page class i used pagePAth object of CStringArray class. I store paths in pagePath object. Now I want to retreive paths by using pagePAth object in CMyView class which is derived from CView class. I am unable to acces pahePAth object in CMyView class. Please send me solution if u have. Thanks in Advance am

          hi

          K Offline
          K Offline
          KarstenK
          wrote on last edited by
          #4

          See the problem an other way: Your CStringArray in the wrong scope (class). :-\ It belongs to a place where both can see it. A common parent or prefer a settings object.

          Greetings from Germany

          1 Reply Last reply
          0
          • A Atul23

            Hi ALL, I am using property page in my project. In Property page class i used pagePAth object of CStringArray class. I store paths in pagePath object. Now I want to retreive paths by using pagePAth object in CMyView class which is derived from CView class. I am unable to acces pahePAth object in CMyView class. Please send me solution if u have. Thanks in Advance am

            hi

            B Offline
            B Offline
            Bram van Kampen
            wrote on last edited by
            #5

            Atul23 wrote:

            I am unable to acces pahePAth object in CMyView class.

            What Exactly happens! How do you try to Access it. As a Member Variable?, or how else; What do you get? a Compiler Error or garbage Data? regards :)

            Bram van Kampen

            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