UAE Placing More than 64K in VB List Box or Combo Box

ID Number: Q73374

1.00

WINDOWS

buglist1.00

Summary:

Attempting to add more than 64K of data into a Visual Basic list box

or combo box will result in a Windows UAE (unrecoverable application

error).

Microsoft has confirmed this to be a problem in Microsoft Visual Basic

programming system version 1.0 for Windows. Microsoft is 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: 1.00