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. Handle to Dialog, In Dialog Application

Handle to Dialog, In Dialog Application

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpc++visual-studiodebugging
4 Posts 4 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.
  • J Offline
    J Offline
    jerry1211a
    wrote on last edited by
    #1

    Hi, I am designing a simple dialog application in VS.net. In the dialog class that is created, I call a class of my own, that is not derived from any MFC class. My class needs access to an Edit control in the main dialog. It looks as if my class needs a handle to the parent class, hlg, in this case the dialog window. QUESTION: How do I find the parent, main dialog, parent window?? I have been trying to find it while setting breakpoints in the debugger. Thanks. Jerry

    D H Steve EcholsS 3 Replies Last reply
    0
    • J jerry1211a

      Hi, I am designing a simple dialog application in VS.net. In the dialog class that is created, I call a class of my own, that is not derived from any MFC class. My class needs access to an Edit control in the main dialog. It looks as if my class needs a handle to the parent class, hlg, in this case the dialog window. QUESTION: How do I find the parent, main dialog, parent window?? I have been trying to find it while setting breakpoints in the debugger. Thanks. Jerry

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

      jerry1211a wrote:

      My class needs access to an Edit control in the main dialog.

      This is not advisable. What is it exactly that you are trying to do?


      "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

      "We will be known forever by the tracks we leave." - Native American Proverb

      1 Reply Last reply
      0
      • J jerry1211a

        Hi, I am designing a simple dialog application in VS.net. In the dialog class that is created, I call a class of my own, that is not derived from any MFC class. My class needs access to an Edit control in the main dialog. It looks as if my class needs a handle to the parent class, hlg, in this case the dialog window. QUESTION: How do I find the parent, main dialog, parent window?? I have been trying to find it while setting breakpoints in the debugger. Thanks. Jerry

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        for access to main dialog you can use GetParent but you said "that is not derived from any MFC class"

        1 Reply Last reply
        0
        • J jerry1211a

          Hi, I am designing a simple dialog application in VS.net. In the dialog class that is created, I call a class of my own, that is not derived from any MFC class. My class needs access to an Edit control in the main dialog. It looks as if my class needs a handle to the parent class, hlg, in this case the dialog window. QUESTION: How do I find the parent, main dialog, parent window?? I have been trying to find it while setting breakpoints in the debugger. Thanks. Jerry

          Steve EcholsS Offline
          Steve EcholsS Offline
          Steve Echols
          wrote on last edited by
          #4

          In your own class create a member to your edit control (like CEdit* m_pEdit). Then create a function to set the member (like SetEdit(CEdit* pEdit) { m_pEdit = pEdit; } ). Then in your own class, use m_pEdit->SetWindowText(...) or GetWindowText(...). Does that work?


          - S 50 cups of coffee and you know it's on!

          • S
            50 cups of coffee and you know it's on!
            Code, follow, or get out of the way.
          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