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. Modeless dialog communicating with parent dialog

Modeless dialog communicating with parent dialog

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestionannouncement
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 a parent dialog instatialing a modeless dialog. My modeless dialog has a public function that updates the progress bar. Everytime I call tmpmodeless->UpdateProgressBar(step) where step is a number to increase, the progress bar show increase on display. I have also a public function in modeless dialog that updates the text for displaying the status tmpmodeless->UpdateMessageStatus(CString mymsg) but I doesnt update the display.. Here is my code: // Variables of modeless dialog CProgressCtrl m_ctrlProgress; // Created using MFC Class wizard so it sure points to the // control id of progress bar. CStatic m_statusdone; // Created using MFC Class wizard so it sure points to the // control id CStatic control id. Also sure that Visible property is checked. CMyParentDialog::MyInitialize() { CMyModelessDialog* tmpmodeless=new CMyModelessDialog(this); tmpmodeless->Create(CMyModelessDialog::IDD); tmpmodeless->ShowWindow(SW_SHOW); tmpmodeless->UpdateProgressBar(10); //OK is reflects on screen tmpmodeless->UpdateMessageStatus("Help me step 10"); doesnt change display.. tmpmodeless->UpdateProgressBar(20); //OK is reflects on screen tmpmodeless->UpdateMessageStatus("Help me step 20"); still doesnt change display.. } void CMyModelessDialog::UpdateProgressBar(int pStep) { m_ctrlProgress.SetPos(pStep); } void CMyModelessDialog::UpdateMessageStatus(CString mymsg) //Doesnt work.. why??????????????? { m_statusdone.SetWindowText(mymsg); UpdateData(TRUE); } Still Doesnt appear even if I manually put m_statusdone.SetWindowText("Test") under UpdateProgressBar because UpdateProgressBar sure does works on setting progressbar. Is there something Wrong with CStatic control???? Thanks.

    J 1 Reply Last reply
    0
    • F fjlv2005

      Good day, I have a parent dialog instatialing a modeless dialog. My modeless dialog has a public function that updates the progress bar. Everytime I call tmpmodeless->UpdateProgressBar(step) where step is a number to increase, the progress bar show increase on display. I have also a public function in modeless dialog that updates the text for displaying the status tmpmodeless->UpdateMessageStatus(CString mymsg) but I doesnt update the display.. Here is my code: // Variables of modeless dialog CProgressCtrl m_ctrlProgress; // Created using MFC Class wizard so it sure points to the // control id of progress bar. CStatic m_statusdone; // Created using MFC Class wizard so it sure points to the // control id CStatic control id. Also sure that Visible property is checked. CMyParentDialog::MyInitialize() { CMyModelessDialog* tmpmodeless=new CMyModelessDialog(this); tmpmodeless->Create(CMyModelessDialog::IDD); tmpmodeless->ShowWindow(SW_SHOW); tmpmodeless->UpdateProgressBar(10); //OK is reflects on screen tmpmodeless->UpdateMessageStatus("Help me step 10"); doesnt change display.. tmpmodeless->UpdateProgressBar(20); //OK is reflects on screen tmpmodeless->UpdateMessageStatus("Help me step 20"); still doesnt change display.. } void CMyModelessDialog::UpdateProgressBar(int pStep) { m_ctrlProgress.SetPos(pStep); } void CMyModelessDialog::UpdateMessageStatus(CString mymsg) //Doesnt work.. why??????????????? { m_statusdone.SetWindowText(mymsg); UpdateData(TRUE); } Still Doesnt appear even if I manually put m_statusdone.SetWindowText("Test") under UpdateProgressBar because UpdateProgressBar sure does works on setting progressbar. Is there something Wrong with CStatic control???? Thanks.

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      fjlv2005 wrote: void CMyModelessDialog::UpdateMessageStatus(CString mymsg) //Doesnt work.. why??????????????? { m_statusdone.SetWindowText(mymsg); UpdateData(TRUE); } Why are you calling UpdateData(TRUE) at that point? Was it just for testing purposes? Make sure your static control uses an identifier different than IDC_STATIC (i.e, -1) -- jlr http://jlamas.blogspot.com/[^]

      F 1 Reply Last reply
      0
      • J Jose Lamas Rios

        fjlv2005 wrote: void CMyModelessDialog::UpdateMessageStatus(CString mymsg) //Doesnt work.. why??????????????? { m_statusdone.SetWindowText(mymsg); UpdateData(TRUE); } Why are you calling UpdateData(TRUE) at that point? Was it just for testing purposes? Make sure your static control uses an identifier different than IDC_STATIC (i.e, -1) -- jlr http://jlamas.blogspot.com/[^]

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

        Good day, Yes Im sure im using ID which is not IDC_STATIC. UpdateData is just for testing... Why does it doesnt update the display for my modesless dialog??

        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