> can anyone help me abou tinclusion in VB6
> i've read it's a kind of class heritage
> but i don't understand what i can do with , and how
> thanks
Never heard about it...
Can it be that you mean "Inheritance by Containment"?
Meaning that you include an instance og an existing class
in your new one, thereby getting access to (inheriting) all
its methods & attributes?
something like this:
' --- Parent (Contained) class -------------------------
private m_sName As String
Public Property let Name(byval s As String)
m_sName = s
End property
Public Property Get Name() As String
Name = m_sName
End property
Public Sub Print()
Debug.Print Me.Name
End Sub
' --- Child (containing) class -------------------------
private m_sPhone As String
private m_oParent as CParent
Public Property let Phone(byval s As String)
m_sPhone = s
End property
Public Property Get Phone() As String
Phone = m_sPhone
End property
' Here I make wrapper methods for Parent, to
' Completely hide the containment.
Public Property let Name(byval s As String)
m_oParent.Name = s
End property
Public Property Get Name() As String
Name = m_oParent.Name
End property
Public Sub Print()
Debug.Print m_oParent.Name
Debug.print Me.Phone
End Sub
' Another alternative, is to expose the contained class like this:
Public Property Get Parent() as CParent
Set Parent = m_oParent
End Property
Private Sub Class_Initialize()
Set m_oParent = New CParent
End Sub
Private Sub Class_Terminate()
Set m_oParent = Nothing
End Sub
' ----------Use ------------
...
Dim m_oChild as CChild
Set m_oChild = New CChild
m_oChild.Name = "Dag"
m_oChild.Phone = "370 12 666"
m_oChild.Print
' Or with an exposed parent:
m_oChild.Parent.Name = "Dag"
m_oChild.Phone = "370 12 666"
m_oChild.Print
...

Signature
Dag.