FIX: ParentControls.Count May Fail on Windows NT 4, Service Pack 4

ID: Q223104


The information in this article applies to:


SYMPTOMS

Under Windows NT Service Pack 4, if a Usercontrol accesses the ParentControls.Count property and there are 32 or more controls on the form, including the Usercontrol and any controls on the Usercontrol, the Visual Basic app might crash.


CAUSE

This is caused by an error in Visual Basic's heap allocation mechanism.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3.

For more information about Visual Studio 6.0 Service Packs, please see the following articles in the Microsoft Knowledge Base:


Q194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

Q194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed


MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new ActiveX Control project in Visual Basic 6.0. UserControl1 is created by default.


  2. Add a CommandButton to the UserControl.


  3. Place the following code in the CommandButton's Click event:


  4. MsgBox UserControl.ParentControls.count 
  5. Click Add Project on the File menu to add a Standard EXE project.


  6. Close the UserControl project.


  7. Place a copy of your Usercontrol on form1 of the Standard EXE Project.


  8. Add 30 TextBoxes to form1 of the Standard EXE project.


  9. Press the F5 key to run the project and click the CommandButton of the Usercontrol.


  10. An Application Error occurs in VB6.exe.



REFERENCES

For additional information, please see the following articles in the Microsoft Knowledge Base:

Q195009 Application Access Violation or Hang After Applying SP4

Q219278 BUG: OLAP MDX Application Gives Application Error in VB IDE

Additional query words:


Keywords          : kbservicepack kbVBp600bug kbNTOS400sp4 kbGrpVB kbVS600sp2 kbVS600SP1 kbVS600sp3fix 
Version           : WINDOWS:6.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: May 20, 1999