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. Dialog Communication

Dialog Communication

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 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.
  • F Offline
    F Offline
    fjlv2005
    wrote on last edited by
    #1

    Good day, I have two dialogs. The MainDialog and WelcomeDialog. WelcomeDialoghas a progress bar and MainDialog has the initialization in which this initialization status is shown in WelcomeDialog progressbar. I have a function in WelcomeDialog IncreaseProgressBarStep(int step) which is public so MainDialog can access it. Here is what i wanted to do. MainDialog::OnInitDialog() { WelcomeDialog childDlg; childDlg.DoModal(); ->InitializationStatement.... childDlg.IncreaseProgressBarStep(10); InitializationStatement.... childDlg.IncreaseProgressBarStep(10); ............(until all initialization is done) done initialization here.... } The problem with this code is that the code with ->InitializationStatement will not be called unless the childDlg is exited, thus childDlg.IncreaseProgressBarStep will be useless. How can we communicate the two dialogs so that WelcomeDialog will stay on the screen while whole initilization is not yet done. Thanks and More Power!

    C 1 Reply Last reply
    0
    • F fjlv2005

      Good day, I have two dialogs. The MainDialog and WelcomeDialog. WelcomeDialoghas a progress bar and MainDialog has the initialization in which this initialization status is shown in WelcomeDialog progressbar. I have a function in WelcomeDialog IncreaseProgressBarStep(int step) which is public so MainDialog can access it. Here is what i wanted to do. MainDialog::OnInitDialog() { WelcomeDialog childDlg; childDlg.DoModal(); ->InitializationStatement.... childDlg.IncreaseProgressBarStep(10); InitializationStatement.... childDlg.IncreaseProgressBarStep(10); ............(until all initialization is done) done initialization here.... } The problem with this code is that the code with ->InitializationStatement will not be called unless the childDlg is exited, thus childDlg.IncreaseProgressBarStep will be useless. How can we communicate the two dialogs so that WelcomeDialog will stay on the screen while whole initilization is not yet done. Thanks and More Power!

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

      Anonymous wrote: The problem with this code is that the code with ->InitializationStatement will not be called unless the childDlg is exited Of course, this is logical. DoModal is a blocking call that will return the return code of closing the dialog. If you want to have childDlg 'not blocking' you will have to make it modeless. That is, maitaint a member variable in MainDialog and show the window. Take a look at this article[^]. It will help you to understand how it works.

      F 1 Reply Last reply
      0
      • C Cedric Moonen

        Anonymous wrote: The problem with this code is that the code with ->InitializationStatement will not be called unless the childDlg is exited Of course, this is logical. DoModal is a blocking call that will return the return code of closing the dialog. If you want to have childDlg 'not blocking' you will have to make it modeless. That is, maitaint a member variable in MainDialog and show the window. Take a look at this article[^]. It will help you to understand how it works.

        F Offline
        F Offline
        fjlv2005
        wrote on last edited by
        #3

        Thanks. It does what I need. More Power!

        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