Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LB_INITSTORAGE: Meaning of lParam parameter?

75 views
Skip to first unread message

Timo Kunze

unread,
Jul 8, 2009, 11:29:12 AM7/8/09
to
Hi,

does anyone know whether the lParam parameter of the LB_INITSTORAGE
message specifies the number of bytes to allocate for one item or the
number of bytes to allocate for all items? The docs are not clear about
this.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."

ScottMcP [MVP]

unread,
Jul 8, 2009, 11:52:18 AM7/8/09
to
On Jul 8, 11:29 am, Timo Kunze <TKunze71...@gmx.de> wrote:
> Hi,
>
> does anyone know whether the lParam parameter of the LB_INITSTORAGE
> message specifies the number of bytes to allocate for one item or the
> number of bytes to allocate for all items? The docs are not clear about
> this.

lParam is the number of bytes PER ITEM.

You are right that the docs for LB_INITSTORAGE are unclear, but the
doc page for CListBox::InitStorage has an example that clarifies this.

Timo Kunze

unread,
Jul 8, 2009, 12:00:03 PM7/8/09
to
Thank you very much.

Christian ASTOR

unread,
Jul 8, 2009, 1:06:20 PM7/8/09
to
On 8 juil, 17:52, "ScottMcP [MVP]" <scott...@mvps.org> wrote:

> lParam is the number of bytes PER ITEM.
>
> You are right that the docs for LB_INITSTORAGE are unclear, but the
> doc page for CListBox::InitStorage has an example that clarifies this.

I think this sample is wrong.
By reading LB structure in GetWindowLongPtr(hListbox, 0), before and
after LB_INITSTORAGE, it seems to allocate lParam and not
wParam*lParam...

Timo Kunze

unread,
Jul 8, 2009, 1:30:56 PM7/8/09
to
Christian ASTOR schrieb:

> I think this sample is wrong.
> By reading LB structure in GetWindowLongPtr(hListbox, 0), before and
> after LB_INITSTORAGE, it seems to allocate lParam and not
> wParam*lParam...
You seem to be right. I did the following test (on Vista x64 SP1):
1) wParam = 16384, lParam = 4096
-> ProcessExplorer reports an increase in the process' private bytes of
132 kB. 16384 * 4096 would be 64 MB.
2) wParam = 16384, lParam = 16384 * 4096
-> ProcessExplorer reports an increase in the process' private bytes of
a bit more than 64 MB.

Thanks

0 new messages