?
Solved

Update Info on statusBar like DevStudio....

Posted on 1997-08-04
3
Medium Priority
?
149 Views
Last Modified: 2013-11-20
Hi!

  I have an application which doing some data loading for a few minutes. During this process I would like to show some information on status bar to let user see progress of loading( somethink like Displaying name of current loaded item and setting index of CProgreesBar). I have a loop which is doing all loading and I tried to use CStatusBar::SetWindowText and CStatusBarCtrl::SetText functions to display name of current item on status bar but it was empty. I would grateful for any help.
0
Comment
Question by:gelbert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1303037
After you set the text, you'll need to let the operating system have some time to process the painting for the status control.

The best way to do that is to use a function like this:

BOOL TWaitingMessages::Pump()
{
      MSG msg;

      while (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
      {
            if (!AfxGetApp()->PumpMessage())
            {
                  ::PostQuitMessage(0);
                  return FALSE;
            }
      }

      LONG idle = 0;
/* If using MFC
      while (AfxGetApp()->OnIdle(idle++))
            ;
*/
      return TRUE;
}

Then right after, you use CStatusBar::SetWindowText(), make a call to TWaitingMessage::Pump() and check if the return value is FALSE. If so, then the user wants to quit.

0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 400 total points
ID: 1303038
Oops, the above should have been the answer.
0
 
LVL 8

Author Comment

by:gelbert
ID: 1303039
Thank you.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question