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 get actual object of class which is in memory

How to get actual object of class which is in memory

Scheduled Pinned Locked Moved C / C++ / MFC
performancetutorial
4 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.
  • S Offline
    S Offline
    shivditya
    wrote on last edited by
    #1

    I have SDI application in which there are two dialogs which are opened at run time. One dialog is modeless and onclick of button on this modeless dialog One modal dialog is coming. Now based on selection of listbox on modal dialog I want to fillup fields on modeless dialog. For the same I require the object of class which is running in memory. How to achieve it.

    || ART OF LIVING ||

    D 1 Reply Last reply
    0
    • S shivditya

      I have SDI application in which there are two dialogs which are opened at run time. One dialog is modeless and onclick of button on this modeless dialog One modal dialog is coming. Now based on selection of listbox on modal dialog I want to fillup fields on modeless dialog. For the same I require the object of class which is running in memory. How to achieve it.

      || ART OF LIVING ||

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

      shivditya wrote:

      Now based on selection of listbox on modal dialog I want to fillup fields on modeless dialog.

      Not possible, since the modal dialog must be dismissed first before the modeless dialog can continue processing its messages.

      shivditya wrote:

      For the same I require the object of class which is running in memory.

      This makes no sense. Please elaborate.


      "A good athlete is the result of a good and worthy opponent." - David Crow

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

      S 1 Reply Last reply
      0
      • D David Crow

        shivditya wrote:

        Now based on selection of listbox on modal dialog I want to fillup fields on modeless dialog.

        Not possible, since the modal dialog must be dismissed first before the modeless dialog can continue processing its messages.

        shivditya wrote:

        For the same I require the object of class which is running in memory.

        This makes no sense. Please elaborate.


        "A good athlete is the result of a good and worthy opponent." - David Crow

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

        S Offline
        S Offline
        shivditya
        wrote on last edited by
        #3

        Actually I myself was able to do it cnc was object of my modeless class. what I done is I declared it in MainFrame.h Then by (CMainFrame*)AfxGetMainWindow()->cnc I was able to get object of modeless class in modal dialog. From cnc I was able to access all fields on form and everything worked out well. Modification -- yes modal dialog closes once I confirm selection,I didnot mentioned that condition,and I think that is even possible for a separate thread.

        || ART OF LIVING ||

        D 1 Reply Last reply
        0
        • S shivditya

          Actually I myself was able to do it cnc was object of my modeless class. what I done is I declared it in MainFrame.h Then by (CMainFrame*)AfxGetMainWindow()->cnc I was able to get object of modeless class in modal dialog. From cnc I was able to access all fields on form and everything worked out well. Modification -- yes modal dialog closes once I confirm selection,I didnot mentioned that condition,and I think that is even possible for a separate thread.

          || ART OF LIVING ||

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

          Sounds rather kludgy, but glad you got it going.


          "A good athlete is the result of a good and worthy opponent." - David Crow

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

          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