Solved

CListctrl performace issue with more number of records

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 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

14 Experts available now in Live!

Get 1:1 Help Now