From: David Lowndes on
>So to conclude, the speed problem can be solved by using SetItemCount()
>instead ot InsertItem() many times. But the upper limit on the number of
>items in a CListCtrl is one hundred million (plus one). Memory is not the
>issue, because task manager shows the memory usage is the same before and
>after adding the 100 million items with SetItemCount(). So the limit seems
>to be arbitrary.

Bill,

Which OS is this on?

It might be worthwhile adding a comment to the online MSDN
documentation to record your findings.

Dave
From: "Bill Brehm" don't want on
Dave,

I'm running WinXP, but probably more importantly, MSVC++ 6.0.

I'll look for this online MSDN and see what I can find / record.

Bill

"David Lowndes" <DavidL(a)example.invalid> wrote in message
news:um79q51bl781o4rntmmfrt0bbfmm8fjc8r(a)4ax.com...
> >So to conclude, the speed problem can be solved by using SetItemCount()
>>instead ot InsertItem() many times. But the upper limit on the number of
>>items in a CListCtrl is one hundred million (plus one). Memory is not the
>>issue, because task manager shows the memory usage is the same before and
>>after adding the 100 million items with SetItemCount(). So the limit seems
>>to be arbitrary.
>
> Bill,
>
> Which OS is this on?
>
> It might be worthwhile adding a comment to the online MSDN
> documentation to record your findings.
>
> Dave


From: Giovanni Dicanio on
"Bill Brehm" <don't want spam> ha scritto nel messaggio
news:uZ1EiF9xKHA.2436(a)TK2MSFTNGP04.phx.gbl...

> So to conclude, the speed problem can be solved by using SetItemCount()
> instead ot InsertItem() many times. But the upper limit on the number of
> items in a CListCtrl is one hundred million (plus one).

Would it be possible to you to test using SetItemCountEx instead of
SetItemCount?

http://msdn.microsoft.com/en-us/library/xb95w29a(VS.80).aspx

http://msdn.microsoft.com/en-us/library/bb775095(VS.85).aspx

<quote>
If the list-view control was created with the LVS_OWNERDATA style, this
macro sets the virtual number of items that the control contains.
If the list-view control was created without the LVS_OWNERDATA style, the
ListView_SetItemCount macro should be used.
</quote>

Giovanni


From: "Bill Brehm" don't want on
I did try SetItemCountEx() as well and got the same result. I do have
LVS_OWNERDATA set in the properties of the control in the resource view. I
shuold point out that I'm using MSVC++ version 6. Maybe in newer versions
the limitation has been removed???

"Giovanni Dicanio" <giovanniDOTdicanio(a)REMOVEMEgmail.com> wrote in message
news:ObPlElnyKHA.2644(a)TK2MSFTNGP04.phx.gbl...
> "Bill Brehm" <don't want spam> ha scritto nel messaggio
> news:uZ1EiF9xKHA.2436(a)TK2MSFTNGP04.phx.gbl...
>
>> So to conclude, the speed problem can be solved by using SetItemCount()
>> instead ot InsertItem() many times. But the upper limit on the number of
>> items in a CListCtrl is one hundred million (plus one).
>
> Would it be possible to you to test using SetItemCountEx instead of
> SetItemCount?
>
> http://msdn.microsoft.com/en-us/library/xb95w29a(VS.80).aspx
>
> http://msdn.microsoft.com/en-us/library/bb775095(VS.85).aspx
>
> <quote>
> If the list-view control was created with the LVS_OWNERDATA style, this
> macro sets the virtual number of items that the control contains.
> If the list-view control was created without the LVS_OWNERDATA style, the
> ListView_SetItemCount macro should be used.
> </quote>
>
> Giovanni
>
>


From: Giovanni Dicanio on
"Bill Brehm" <don't want spam> ha scritto nel messaggio
news:#ScAsVuyKHA.2552(a)TK2MSFTNGP04.phx.gbl...

> I did try SetItemCountEx() as well and got the same result. I do have
> LVS_OWNERDATA set in the properties of the control in the resource view. I
> shuold point out that I'm using MSVC++ version 6. Maybe in newer versions
> the limitation has been removed???

I tried a quick test building a dialog-based MFC app with VS2010 RC.
Basically, the dialog hosts a virtual list control, that has two columns:
the first one shows the index value (e.g. 0,1,2,3...,<count-1>), the second
one is just left empty.

I built the app in 64-bit and run the test: my results on Windows 7 x64 are
that the virtual list control displays properly for count <= 100,000,000.
Instead, for count > 100,000,000 an empty list is displayed.

Weird...

Giovanni