FIX: UAE When Place More than 64K in VB List Box or Combo Box

Last reviewed: October 30, 1997
Article ID: Q73374
1.00 2.00 WINDOWS kbenv kbbuglist

The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, version 2.0
- Microsoft Visual Basic programming system for Windows, version 1.0 - Microsoft Windows, versions 3.0 and 3.1

SYMPTOMS

Attempting to add more than 64K of data into a Visual Basic list box or combo box will result in a Windows Unrecoverable Application Error (UAE), when running under Windows version 3.0.

RESOLUTION

This problem does not occur when running under Windows version 3.1. However, attempting to add more than 64K of data into a Visual Basic list box or combo box will result in an "out of memory" error message, when running under Windows, version 3.1.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Visual Basic programming system for Windows, versions 1.0 and 2.0. We are researching this problem and will post new information here as it becomes available.

MORE INFORMATION

Each item of a list box or combo box can contain a string up to 1K in length; however, if the total of all items exceeds 64K, a UAE will be generated. The .List() property for list boxes and combo boxes is given its own segment up to 64K in size. If an attempt to exceed this limit is made, an "Out of memory" or "Out of string space" error message should result, but instead a UAE occurs and the program terminates.

Steps to Reproduce Problem

  1. Create a New Project.

  2. Draw a list box on Form1.

  3. Add the following code to Form1's Click() event procedure:

       Sub Form_Click()
          Do
             List1.Additem String$(1024, "X")
             I = I + 1
             Debug.Print I
          Loop
       End Sub
    
    
When the UAE occurs, note that the value of the variable "I" displayed in the Immediate window will be 63. The UAE occurred when adding the 64th item, which caused the total size of the data in the list box to exceed 64K. The actual limit is slightly under 64K due to a small amount of overhead to manage the .List() property because it is a property array.


Additional reference words: buglist1.00 buglist2.00 fixlist3.00 1.00 2.00
3.00
KBCategory: kbenv kbbuglist
KBSubcategory: EnvtRun
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.