Solved

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

Posted on 2004-08-23
4
162 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 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 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