Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-08-23
4
Medium Priority
?
168 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
[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
4 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 100 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 45

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

598 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