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 update main window from a child dialog??

How to update main window from a child dialog??

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestionannouncement
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.
  • K Offline
    K Offline
    Kiran Satish
    wrote on last edited by
    #1

    Hi, I am having this image viewing program where I have a dialog that gets created (using DoModal) for adjusting brightness/contrast with initial values set by main frame. I would like to know how I can update the image thats being displayed on main frame whenever I change the values in the pop up dialog. thanks in advance, -PNT

    PKNT

    M 1 Reply Last reply
    0
    • K Kiran Satish

      Hi, I am having this image viewing program where I have a dialog that gets created (using DoModal) for adjusting brightness/contrast with initial values set by main frame. I would like to know how I can update the image thats being displayed on main frame whenever I change the values in the pop up dialog. thanks in advance, -PNT

      PKNT

      M Offline
      M Offline
      mcsherry
      wrote on last edited by
      #2

      one way is to use SendMessage to send the updated values

      M 1 Reply Last reply
      0
      • M mcsherry

        one way is to use SendMessage to send the updated values

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        or pass a pointer to the main window to the child dialog. or use the observer/observable pattern.


        Maximilien Lincourt Your Head A Splode - Strong Bad

        K 1 Reply Last reply
        0
        • M Maximilien

          or pass a pointer to the main window to the child dialog. or use the observer/observable pattern.


          Maximilien Lincourt Your Head A Splode - Strong Bad

          K Offline
          K Offline
          Kiran Satish
          wrote on last edited by
          #4

          yep got it.... the problem is I am including the header file of my child dialog in my DOC header file and when I try to define a pointer to to a doc object in my child dialog's header file by including the main frame's header file in it, it gave me error of undefined symbol error. Then i tried to include the child dialog's header file in the main frame's cpp file and now its working fine. thanks for your replies.

          PKNT

          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