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
Solved

Give some time to treat regular pending messages in a function...

Posted on 2004-08-23
4
161 Views
Last Modified: 2013-11-20
I have a simple linear interpolation function :

     i=1;
     while (rows[i].values[COL_DRIFT].number == 0) i++;               // Find first non-zero drift;
     j=i+1;                                                                      // Restriction : what if the second drift is genuinly 0 ???
     while (rows[j].values[COL_DRIFT].number == 0) j++;               // Find second non-zero drift;
     int iHz = j-i;                                                            // Compute the inverse number of Hz Drift is recorded at
     while (i+iHz <= csv_count)
     {
          for (j=1; j<iHz; j++){
               rows[i+j].values[COL_DRIFT].number     = (rows[i].values[COL_DRIFT].number)*(iHz-j)/iHz + (rows[i+iHz].values[COL_DRIFT].number)*j/iHz;
          }
          i = i + 4;
     }
     for (j=1; j<csv_count-i ; j++)
          rows[i+j].values[COL_DRIFT].number     = rows[i].values[COL_DRIFT].number;


However this is taking a little bit of time during which my CPropertyPageEx is not refreshed.
How do I include some call to a "refresh window" function, like say, I want to have a progress bar updated... ?
0
Comment
Question by:jmto
4 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 50 total points
ID: 11873290
You can use UpdateWindow or RedrawWindow functions inside somewhere in your for() loops.
0
 

Author Comment

by:jmto
ID: 11874101
should've tried before asking...
I don't need to do anything, it does refresh the control auto...
Sorry to bother.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 11878362
You need a function to process pending messages in the queue.  You call it during the processing in one of your loops.

eg.
void DoEvents()
{
    MSG msg;
    while ( PeekMessage( &msg, 0, 0, PM_REMOVE))
               DispatchMessage( &msg);
}
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

839 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