Solved

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

Posted on 2004-08-23
4
156 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
Comment Utility
You can use UpdateWindow or RedrawWindow functions inside somewhere in your for() loops.
0
 

Author Comment

by:jmto
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 47
Adapt this command to show who installed 29 102
substring method in java 1 79
Path of Workbook 3 44
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now