HyperEngineer
Programmer
Iam trying to monitor progress within a for loop. I use the UpdateData(FALSE) function to update text boxes on the form. However, the updates are not recorded until it exits the loop. Only the last set of variables are updated to the text boxes.
// Start the process
for (int i = 1; i < Y; i++)
{
for (int j = i + 1; j < X; j++)
{
ulFind = FindResult(i, j);
if (ulFind > (unsigned) m_Result)
{
// Update the variables
m_Result = (long)ulFind;
m_Stage1 = i;
m_Stage2 = j;
UpdateData(FALSE);
}
}
}
// Start the process
for (int i = 1; i < Y; i++)
{
for (int j = i + 1; j < X; j++)
{
ulFind = FindResult(i, j);
if (ulFind > (unsigned) m_Result)
{
// Update the variables
m_Result = (long)ulFind;
m_Stage1 = i;
m_Stage2 = j;
UpdateData(FALSE);
}
}
}