Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my MFC ugly code using CListCtrl report style:

A::moveform()
{
CListCtrl.insertitem(item);
CListCtrl.SetItemText(stritem);
UpdateData(FALSE);
}

A::Caller()
{
for(int i = 0;i<100;i++)
moveform();

return;

}

Caller call moveform() for 100 times.
I want to show the every row when each loop.
But the result of the above program, at the 'return;' point,
the all rows are shown at the completion of 100 loops.

Which one of you show the right method?

What I have tried:

More 1 weeks wasted to solve the problems.
Posted
Updated 17-Apr-16 1:52am

1 solution

That is the way that Windows works. Your repeated calls to moveform is preventing the updates from getting actioned until the loop terminates, and you start pulling messages from the queue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900