Solved

CListctrl performace issue with more number of records

Posted on 2006-07-11
2
703 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Include multiple hostnames in this command? 3 53
Separate files macro - Errors on larger data set 18 65
wait notify demo infinite loop 3 96
wordappend challenge 8 150
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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 …

861 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now