FIX: ParentControls.Count May Fail on Windows NT 4, Service Pack 4
ID: Q223104
|
The information in this article applies to:
-
Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 6.0
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
- Create a new ActiveX Control project in Visual Basic 6.0. UserControl1 is created by default.
- Add a CommandButton to the UserControl.
- Place the following code in the CommandButton's Click event:
MsgBox UserControl.ParentControls.count
- Click Add Project on the File menu to add a Standard EXE project.
- Close the UserControl project.
- Place a copy of your Usercontrol on form1 of the Standard EXE Project.
- Add 30 TextBoxes to form1 of the Standard EXE project.
- Press the F5 key to run the project and click the CommandButton of the Usercontrol.
- 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