PRB: Out of Memory Error Using VB Outline Control

Last reviewed: February 18, 1996
Article ID: Q107769
The information in this article applies to:

- Professional Edition of Microsoft Visual Basic for Windows,

  version 3.0

SYMPTOMS

MSOUTLIN.VBX is the outline custom control file in Visual Basic. An out of memory error can occur with an outline control for the reasons shown in the Cause section below.

CAUSE

An outline custom control can give an out of memory error if it contains more than 6537 items or uses too much string space. Each item cannot exceed 1K.

Each form is limited to a single 64K data segment for all properties of the form and all properties of controls on that form. All data that you add at run time to the outline controls on a form is stored in this same, shared 64K data segment. String space for outline controls will thus be limited by memory used by other controls on that form.

If the out of memory error occurs at design time instead of run time, you may be running into a code size limitation.

STATUS

This behavior is by design.

MORE INFORMATION

The size allowed for the List property of an outline control is smaller than for the following controls that store data in separate segments of memory:

  • The List property of a combo box control or list box control.
  • The Text property of a text box control that has the MultiLine property set to True.

Steps to Reproduce Behavior

  1. If the MSOUTLIN.VBX custom control file is not already loaded in Visual Basic, choose Add File from the File menu to load it.

  2. Add three outline controls to Form1.

  3. Design the program to fill up the controls with 300 outline records of 60 bytes each at run time. Use the AddItem method to add records.

  4. Start the program.

A customer reported an out of memory error while populating the third control with the 200th item. The point at which you receive an error will depend upon the memory usage of other controls on the form.

REFERENCES

  • "Visual Basic 3.0: Programmer's Guide," pages 641-642 of "Appendix D: Specifications and Limitations."


Additional reference words: 3.00
KBCategory: kbprg kbprb
KBSubcategory: PrgCtrlsCus


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: February 18, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.