Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List view - Add multiple items?

Status
Not open for further replies.

shteev

Programmer
Jul 15, 2003
42
I'm writing a database app in Visual C++ 6, using a listview to display my items; up to about 6,000 of them. I'm finding InsertItem() quite slow. Is there a way I can Insert multiple items into the list with a single command, and then edit them when they are in place?
 
>I'm writing a database app in Visual C++ 6

Good luck

>Is there a way I can Insert multiple items into the list with a single command

Well, every time you insert an item the control is redrawn, which hogs a bit of performance.

You could prevent this by using the (CWnd) methods LockWindowUpdate and UnlockWindowUpdate.

Ie
Code:
mTheListCtrl.LockWindowUpdate();
// Add all items
  .
  .
  
mTheListCtrl.UnlockWindowUpdate();


/Per
Nerdy signatures are as lame as the inconsistent stardates of STTNG.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top