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

ID: Q73374


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for Windows, version 2.0
  • Microsoft Visual Basic programming system for Windows, version 1.0
  • Microsoft Windows versions 3.0, 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 query words: buglist1.00 buglist2.00 fixlist3.00 2.00 3.00

Keywords :
Version :
Platform :
Issue type :


Last Reviewed: September 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.