CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005
    Posts
    5

    Window Redraw Issue

    I have an application that pops up a modal dialog box during a long calculation. This dialog box is supposed to show the progress during the calculation. this works fine so long as the user does not drag another window over the window, however if they do then the window redraws do not seem to work (or if another window covers this window then is minimized it does not seem to redraw the window either!)

    Below is a snippet of the code i am using

    CCalcualtionDialog:oCalculation()
    {
    for(i=0;i<quadrangearray.GetSize();i=i+2)
    {
    // Do Calcuation

    // Attempt to update window
    progressdlg.m_progresstext.Format("Done Iteration %d, i);
    progressdlg.m_progresstext3 = "";
    progressdlg.UpdateData(FALSE);
    progressdlg.UpdateWindow();
    progressdlg.ShowWindow(SW_SHOW);

    }
    }

    If anyone knows how to force the update so it works correctly can you help me

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Window Redraw Issue

    Is the progress dialog shown from same thread ? If yes, you should to show the progress from separate thread and send messages to that thread about the progress, a single threaded aproach would block the window proc of current window.
    Regards,
    Ramkrishna Pawar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured