Re: CListCtrl size at runtime
I wouldn't load more than a few hundred items into a list control directly.
They start to run really slowly after a while and it takes a lot of time.
You can use the EnsureVisible() call with a virtual list and you would just
add your data to your object array (that you would use to supply the
information to the control as it requests it). That data could even be in
an external file like an .MDB file if you need to sort it different ways.
You still have all the data (I typically use an object array of some sort)
so you can write it to the file easily from the array.
I'm sure everyone here would be happy to help if you have any specific
questions along the way, but check out the link I posted in the previous
message... well, here is again since it's still on my clipboard:
http://msdn.microsoft.com/en-us/library/ye4z8x58(VS.80).aspx
Tom
"Gary" <Gary@discussions.microsoft.com> wrote in message
news:19217028-DD8C-4D9A-A4DB-125C0BF61039@microsoft.com...
Thanks a lot Tom.
So a few hundred items (< 500, 000) ok for a normal CListCtrl ?
I did ask you a few question in my reply to your previous comment
regarding
usage of virtual list control.
In my application I need to keep on appending items to the control as they
are received forever. I automatically scroll to the last item using
EnsureVisible().
My only concern will be when I want to save the items from the list
control
to a text file when the user prompts me to do so.
I don't need to load any items at startup, my list control will be empty.
Thanks,
Gary
"Tom Serface" wrote:
I agree with some of the others that after a few hundred items you will
want
to consider a virtual list control. They are very easy to set up, the
data
can come from just about anywhere, and they are way quicker for
displaying.
You can even have some of the data cached in a file or database or
whatever
so long as it can be accessed when needed. That said, I don't think
you'll
reach the limit. Before that happened no one would be willing to use
your
application.
Tom
"Gary" <Gary@discussions.microsoft.com> wrote in message
news:FCACADAD-7521-4333-832B-F1F653143BAF@microsoft.com...
Hi,
I would like to know how many items can I insert into a CListCtrl.... ?
I am not using virtual list control.....
I am just using CListCtrl in a form view..........
I just want to keep on adding possibly millions of items at runtime and
save
them to a text file is user wants to...........
I don't want to load those many items..........
InsertItem() takes "int" as parameter index......so CListCtrl should
atleast
support
(???2,147,483,648 to 2,147,483,647) items..........
I just want to make sure I can add as many items as I want at run
time...
Any pointers would be apprciated.
Thanks,
Gary