Skip to content

Commit 67afcae

Browse files
authored
Clarify CListBox::InitStorage parameters
The meaning of the lParam has been a source of confusion. Clarified the text for lParam and cleaned up the wParam, return value, and blurb. (Also avoid overselling the message. Change "the shortest possible time" to just "more efficient". Because it's still not "the shortest possible time", but it's shorter than it would be without the message.) https://groups.google.com/g/comp.os.ms-windows.programmer.win32/c/MtviqqbHDQs/m/2a2PGs0xmJMJ This is the MFC counterpart to win32-pr#3259
1 parent dc8d3f1 commit 67afcae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/mfc/reference/clistbox-class.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -873,20 +873,20 @@ int InitStorage(
873873
### Parameters
874874
875875
*`nItems`*<br/>
876-
Specifies the number of items to add.
876+
Specifies the number of items to for which to reserve space.
877877
878878
*`nBytes`*<br/>
879-
Specifies the amount of memory, in bytes, to allocate for item strings.
879+
Specifies the amount of additional memory, in bytes, to allocate for item strings.
880880
881881
### Return Value
882882
883883
If successful, the maximum number of items that the list box can store before a memory reallocation is needed, otherwise `LB_ERRSPACE`, meaning not enough memory is available.
884884
885885
### Remarks
886886
887-
Call this function before adding a large number of items to a `CListBox`.
887+
You can call this function before adding a large number of items to a `CListBox`.
888888
889-
This function helps speed up the initialization of list boxes that have a large number of items (more than 100). It preallocates the specified amount of memory so that subsequent [`AddString`](#addstring), [`InsertString`](#insertstring), and [`Dir`](#dir) functions take the shortest possible time. You can use estimates for the parameters. If you overestimate, some extra memory is allocated; if you underestimate, the normal allocation is used for items that exceed the preallocated amount.
889+
This function helps speed up the initialization of list boxes that have a large number of items (more than 100). It preallocates the specified amount of memory so that subsequent [`AddString`](#addstring), [`InsertString`](#insertstring), and [`Dir`](#dir) functions are more efficient. You can use estimates for the parameters. If you overestimate, the extra rmemory remains allocated; if you underestimate, the list box will allocate additional memory as necessary.
890890
891891
Windows 95/98 only: The *`nItems`* parameter is limited to 16-bit values. This means list boxes cannot contain more than 32,767 items. Although the number of items is restricted, the total size of the items in a list box is limited only by available memory.
892892

0 commit comments

Comments
 (0)