My list control item will only be shown up when the function was stopped. I need to show the list control item one by one when the function is running.
Another function continually passes values to HRESULT function() until data processing is done.
//function to show the list item
HRESULT function(datetime, strNumOfGroup, strDisributionRegion, strSpeed){
m_count = m_hyperTerminal.GetItemCount();
items = m_hyperTerminal.InsertItem(m_count, datetime);// Five columns in the list control
m_hyperTerminal.SetItemText(items, 1, strNumOfGroup);
m_hyperTerminal.SetItemText(items, 2, strCompactness);
m_hyperTerminal.SetItemText(items, 3, strDistributionRegion);
m_hyperTerminal.SetItemText(items, 4, strSpeed);
}
This is animation and it generally needs a second thread to update the display.
However using a second thread might be overkill. You may call
SetTimerto update the window at fixed intervals. Then catchWM_TIMERmessages, inOnTimerdo all the updates inOnTimer. Once you are finished with the animation, callKillTimerExample: