?
Solved

CListctrl performace issue with more number of records

Posted on 2006-07-11
2
Medium Priority
?
714 Views
Last Modified: 2013-11-20
Hi All,

I am facing  high performance problem when working with CListCtrl with owner draw data and styles.

When  i am inserting 3000 records it takes more time. I want to avoid this delay. My idea is insert around 100 records initially and in background insert the remaining records. So user no need to wait till insert operation completes.  Which is the best solution to solve this type problems. I cant change existing functionalities for Virtual list control.

Different ideas in my mind are
1) Use thread function to insert the data as background process
2) Insert the data into the list control when user scroll the list
3) Use the Peekmessage and Pump message instead of going for thread.

Please suggest me the solution/suggestion if any one faced like this problem.

Thanks.
Jerin
0
Comment
Question by:jerinjohn
[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
2 Comments
 
LVL 11

Accepted Solution

by:
KurtVon earned 100 total points
ID: 17085877
Well, you could try turning off drawing with SetRedraw until all the items have been inserted and see if that speeds things up enough to be usable.

I've also used the background inserting technique, but it requires a great deal of thread-safe programming with critical sections.  Also make sure the thread knows to exit if the control it is inserting into goes away.

Peek and pump will work too, but make sure the user can't close the dialog/change the data until after everything is inserted.  Since Microsoft uses this technique I suspect it is the recommended one (or at least one that won't confuse the user).

Doing it as a scroll bar is not a good idea.  The size of the scroll thumb is used by most people for estimating the amount of data.  Nobody will like having the thing grow every time they scroll down.  Not to mention that if the data they want is near the bottom they will have to scroll 100 lines at a time . . . too much of a pain.

Hope this helps.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

718 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