BUG: Class Builder Does Not Handle Base Classes Properly
ID: Q189740
|
The information in this article applies to:
-
Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, versions 5.0, 6.0
SYMPTOMS
The Class Builder Utility incorrectly displays derived classes and base
class properties.
RESOLUTION
Before creating a derived class, select the appropriate base class in the
Class pane. In the Class Module Builder dialog, select the base class in
the Based On list and check the box for "This Class is a Top Level Object."
Alternatively, create the derived class directly with code, without using
the class builder utility.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products
listed at the beginning of this article. We are researching this
bug and will post new information here in the Microsoft Knowledge
Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Behavior
- Add the following classes using the Class Builder Utility:
- Add a class called Person; with two properties Age and FirstName.
- Add a class called Employee based on Person.
- Add a class called Customer based on Person.
At this point you will find that Customer is actually subordinate to
Employee instead of Person; this would seem to be wrong because we
indicated that Customer was supposed to be based on Person. Instead,
Customer was based on the Employee class because that was the selected
class in the Classes pane.
- Delete the Customer class.
- Select the Person class in the Classes pane.
- Add a class called Customer based on Person.
This creates a perceived hierarchy of classes in the Class pane, but
Employee and Customer were created as components of Person, rather than
derivatives. Examine the properties of each class to see that Person has
both Customer and Employee as additional properties. Customer has
Employee as a property and Employee has no properties.
To workaround this problem, do the following:
- Delete the Employee and Customer classes.
- Select the Person class and create a new class. Choose Person in the
Based On list and check the box for "This Class is a Top Level Object."
When this new class is created, view its properties and note that it has
the same properties as Person. Also note that the new class is at the
same "level" in the Class pane as the Base class. This is correct; a
derived class is not a subordinate or child of the base class.
REFERENCES
Books Online for Microsoft Visual Basic, version 5.0
Books Online for Microsoft Visual Basic, version 6.0
Additional query words:
kbDSupport kbdss kbVBp500bug kbWizard kbVBp kbVBp600bug
Keywords : kbGrpVB
Version :
Platform : WINDOWS
Issue type : kbbug