Microsoft KB Archive/73374

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

Article ID: 73374

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 1.0 Standard Edition
 * Microsoft Windows 3.0 Standard Edition
 * Microsoft Windows 3.1 Standard Edition

-



This article was previously published under Q73374



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 &quot;out of memory&quot; 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 &quot;Out of memory&quot; or &quot;Out of string space&quot; error message should result, but instead a UAE occurs and the program terminates.

Steps to Reproduce Problem
 Create a New Project. Draw a list box on Form1.  Add the following code to Form1's Click event procedure: Sub Form_Click Do        List1.Additem String$(1024, &quot;X&quot;) I = I + 1 Debug.Print I     Loop End Sub 

When the UAE occurs, note that the value of the variable &quot;I&quot; 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: kbbug kbfix KB73374

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.