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 obtain data from other member function?

how to obtain data from other member function?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
11 Posts 6 Posters 2 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.
  • G gentleguy

    dear all i am confused how to get previous function data? for example: void CAutoDetHumanDlg::OnSmoothImg(){imagedata=processedimage} void CAutoDetHumanDlg::OnCalculateFeatures(){here i need processedimage data} how can i obtain it from first function? thanks a lot. sorry, i am newbie

    gentleguy

    C Offline
    C Offline
    Cedric Moonen
    wrote on last edited by
    #2

    Make it a member of your class. This way, it will be accessible from within any of your class member function.

    Cédric Moonen Software developer
    Charting control [v1.4]

    G 1 Reply Last reply
    0
    • G gentleguy

      dear all i am confused how to get previous function data? for example: void CAutoDetHumanDlg::OnSmoothImg(){imagedata=processedimage} void CAutoDetHumanDlg::OnCalculateFeatures(){here i need processedimage data} how can i obtain it from first function? thanks a lot. sorry, i am newbie

      gentleguy

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #3

      For instance making processedimage (or imagedata) member of the CAutoDetHumanDlg class. :)

      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.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      In testa che avete, signor di Ceprano?

      G 1 Reply Last reply
      0
      • C Cedric Moonen

        Make it a member of your class. This way, it will be accessible from within any of your class member function.

        Cédric Moonen Software developer
        Charting control [v1.4]

        G Offline
        G Offline
        gentleguy
        wrote on last edited by
        #4

        thanks for your suggestion. now i have done the first function what i mentioned in former post, now i would like to use first function data in second function, how to get it?thanks a lot

        gentleguy

        D C 2 Replies Last reply
        0
        • G gentleguy

          thanks for your suggestion. now i have done the first function what i mentioned in former post, now i would like to use first function data in second function, how to get it?thanks a lot

          gentleguy

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

          If the data belongs to the CAutoDetHumanDlg class, it is accessible by any of its members. Just use it.

          "Love people and use things, not love things and use people." - Unknown

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

          G 1 Reply Last reply
          0
          • CPalliniC CPallini

            For instance making processedimage (or imagedata) member of the CAutoDetHumanDlg class. :)

            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.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            G Offline
            G Offline
            gentleguy
            wrote on last edited by
            #6

            thanks, now if i don't change anything, i have done first function already, now i am doing second function, i need first function data. so how to get it?thanks a lot

            gentleguy

            L 1 Reply Last reply
            0
            • D David Crow

              If the data belongs to the CAutoDetHumanDlg class, it is accessible by any of its members. Just use it.

              "Love people and use things, not love things and use people." - Unknown

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

              G Offline
              G Offline
              gentleguy
              wrote on last edited by
              #7

              yes, you can see all belong to CAutoDetHumanDlg class, but how to get it? i don't know? sorry, thanks

              gentleguy

              D 1 Reply Last reply
              0
              • G gentleguy

                thanks for your suggestion. now i have done the first function what i mentioned in former post, now i would like to use first function data in second function, how to get it?thanks a lot

                gentleguy

                C Offline
                C Offline
                Cedric Moonen
                wrote on last edited by
                #8

                Do you read and try to understand the answers that are given to you ?

                Cédric Moonen Software developer
                Charting control [v1.4]

                N 1 Reply Last reply
                0
                • G gentleguy

                  yes, you can see all belong to CAutoDetHumanDlg class, but how to get it? i don't know? sorry, thanks

                  gentleguy

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

                  gentleguy wrote:

                  but how to get it?

                  Both OnSmoothImg() and OnCalculateFeatures() access the data in the same way.

                  "Love people and use things, not love things and use people." - Unknown

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

                  1 Reply Last reply
                  0
                  • C Cedric Moonen

                    Do you read and try to understand the answers that are given to you ?

                    Cédric Moonen Software developer
                    Charting control [v1.4]

                    N Offline
                    N Offline
                    Nelek
                    wrote on last edited by
                    #10

                    This is a rethoric question, isn't it? :rolleyes:

                    Regards. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson Rating helpfull answers is nice, but saying thanks can be even nicer.

                    1 Reply Last reply
                    0
                    • G gentleguy

                      thanks, now if i don't change anything, i have done first function already, now i am doing second function, i need first function data. so how to get it?thanks a lot

                      gentleguy

                      L Offline
                      L Offline
                      led mike
                      wrote on last edited by
                      #11

                      gentleguy wrote:

                      so how to get it?

                      Get a book and study it to start with. There are many but something like this[^] is a good place to start.

                      led mike

                      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