Microsoft KB Archive/135519

= BUG: Creating 500 Instances of a Form Class Causes IC Error =

Article ID: 135519

Article Last Modified on 5/6/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q135519



SYMPTOMS
Attempts to create 500 instances of a form class containing a small number of controls in a FOR loop causes an "Internal Consistency Error" (ICE).

The number of instances it can instantiate from a form class before an ICE occurs depends on the amount of RAM and the operating system on your computer.

NOTE: On 16-bit operating systems, such as Windows for Workgroups 3.11, you may get the following error message instead of an ICE:

There is not enough memory to complete this operation.

In Visual FoxPro 5.0, the message "Too Many Windows Open" appears and the program ends. FoxPro does not exit.

In Visual FoxPro 5.0a, the message "Too Many Windows Open" appears, and the program removes all the instances of the form class from the screen. FoxPro does not abnormally terminate.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Problem
  Enter the following command in the Command window: CREATE CLASS x OF x AS FORM  Add the following objects to the form:

Text Box

list box

Option Group

check box

Spinner

 Press CTRL+W to save the class, and exit from the Class Designer.  Enter the following command in the Command window: MODIFY COMMAND mul_inst.prg   Type the following code into Mul_Inst.prg: SET CLASSLIB TO X  PRIVATE i   FOR i = 1 TO 500 string = "x" + ALLTRIM(STR(i)) &string = CREATEOBJECT('x') IF &string..Left = 500 &string..Left = 1 ENDIF &string..Left = &string..Left+3 &string..Caption = string &string..Show NEXT i                         Enter the following command in the Command window: DO MUL_INST.PRG </li></ol>

Additional query words: kbvfp300b kbvfp500 kbvfp600

Keywords: kbbug KB135519

-

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

© Microsoft Corporation. All rights reserved.