Solved

CListctrl performace issue with more number of records

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

839 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