Solved

CListctrl performace issue with more number of records

Posted on 2006-07-11
2
705 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
2 Comments
 
LVL 11

Accepted Solution

by:
KurtVon earned 50 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to calculate times for developing software? 8 67
Whole sheet autoscrub still needed 19 50
How to determine file rename from EventLog ? 2 49
sumNumber challenge 16 122
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: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

776 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