Article ID: 129837
Article Last Modified on 12/9/2003
Class CTopLevel Class CSecondLevelClass CTopLevel has the object members.
Public ChildObject As CSecondLevel Public ParentString As StringClass CSecondLevel has the object member.
Public ChildString As StringIn the Initialize event of CTopLevel, you set the ChildObject:
Private Sub CTopLevel_Initialize ()
Set ChildObject = New CSecondLevel
ChildObject.ChildString = "I'm a child object."
End Sub
If the CTopLevel class is created and goes out of scope after the End Sub
in the following code:
Private Sub Form_Click ()
Dim ParentObject As New CTopLevel
ParentObject.ParentString = "I'm a parent object."
End Sub
a CSecondLevel object (ChildObject) is explicitly instantiated in the
CTopLevel_Initialize event, but implicitly destroyed when ParentObject goes
out of scope at the end of the Form_Click Sub procedure.
Additional query words: 4.00 vb4win vb4all
Keywords: KB129837