Re: CListCtrl size at runtime
Not difficult or time consuming at all. Maybe 15 minutes worth of work at
the end.
Basically you have to set the LVS_OWERDATA (not be confused with
LVS_OWNERDRAW....).
Then you tell the list control how many items you have by calling
SetItemCount.
Then you hande the LVN_GETDISPINFO message and return a string int the
LV_DISPINFO struct passed to your handler method.
You would normally store the strings in a container class (array, map, maybe
even a database). When LVN_GETDISPINFO will tell you which item it wants
the text for.
Here are some working examples:
http://www.codeproject.com/KB/list/virtuallist.aspx
http://www.codeguru.com/cpp/controls/listview/advanced/article.php/c4151/
AliR.
"Gary" <Gary@discussions.microsoft.com> wrote in message
news:9631EA8E-CF5D-4314-9784-3C9882EB94AE@microsoft.com...
Thanks AliR.
How difficult and time consuming it is to convert code from using
CListCtrl
to using virtual list control ?
Also can I use the virtual list control in a form view ?
Thanks,
Gary
"AliR (VC++ MVP)" wrote:
Even a couple of hundred items with 2 or 3 sub items will take long
enough
that you will have to switch to virtual list mode. If you ask me virtual
list mode should be standard on list control, they should do away with
the
normal mode.
AliR.
"Serge Wautier" <serge@wautier.nospam.net> wrote in message
news:uez$7GXSJHA.1160@TK2MSFTNGP02.phx.gbl...
I am not using virtual list control.....
I just want to keep on adding possibly millions of items at runtime
Then you're out of luck. My own experience is that virtual list mode is
necessary to keep the list responsive at load AND destroy time as soon
as
you have more than a couple thousands items.
See Giovanni's answers for more details. FWIW, "owner-data" = "virtual
list"
HTH,
Serge.
http://www.apptranslator.com - Localization tool for your MFC
applications
"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