CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2003
    Location
    India Trichy
    Posts
    245

    What is the maximum number of strings we can..

    Hi gurus
    1) What is the maximum number of strings we can store in ListBox (Win32)?

    2) if I want store more then that what should I do?

    Regards
    Balamurali C

  2. #2
    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    762
    I'm pretty sure it's only limited to your computer's hardware (i.e. if 9 billion items takes up 1GB of ram and you have 100MB, it won't go(not counting virtual memory ****))

  3. #3
    Join Date
    Jun 2003
    Location
    India Trichy
    Posts
    245
    Hei kasracer
    i have read some articles that maximum (arround) 32000 string (each string have default length) element only we can store in the ListBox. so that im wondering.

    regards
    balamurali c

  4. #4
    Join Date
    Nov 2003
    Location
    malaysia
    Posts
    30
    Hi,

    Try to keep track on the insufficient space.....

    CListBox temp;

    if(temp.InsertString("abc") == LB_ERRSPACE)
    {
    //Clear the buffer of the ListBox
    ...................
    }

  5. #5
    Join Date
    Mar 2001
    Location
    Xi'an Shaanxi, China
    Posts
    60
    I know that there is a tech. called "Virtual List Control", in fact, it is just a feature of CListCtrl, a listctrl will support this feature when you set LVS_OWNERDATA style. You can find the detail in MSDN.
    I don't go any further myself, so I can't give you any more help..
    Nothing changes, but us.

  6. #6
    Join Date
    Jun 2003
    Location
    India Trichy
    Posts
    245
    ya
    Im using pure win32 application not MFC, then how can I do this.
    (Virtual list control supported by MFC)
    regards
    balamurali c

  7. #7
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626
    a CListBox is limited to 2^15-1 items.
    Theoretically a CListCtrl is limited to 2^31-1 items, because that's the range of allowed indices, but the actual count will be much lower due to memory constraints.

    The max number of items (if the listcontrol doesn't store the strings, but retrieves them dynamically) is about 90,000,000.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured