First of all thanks for replying!I will show you what I'm trying to do. Please note I use ArcObject names but this VB project has no reference to ESRI libraries! I just use them as I'm familiar with their true behaviour. I think this will help you understand what I'm trying to achieve.I declare my interfaces and classesPublic Interface ILayer
Property Name() As String
End Interface
Public Interface IFeatureLayer
Inherits ILayer
End Interface
Public Class baseLayer
Implements ILayer
Private m_Name As String
Public Property Name() As String Implements ILayer.Name
Get
Return m_Name
End Get
Set(ByVal value As String)
m_Name = Name
End Set
End Property
End Class
Public Class Featurelayer
Inherits baseLayer
End Class
I created a form, dropped a button on it and on the on click event I attempt to run the following codeDim pLayer As ILayer
pLayer = New baseLayer
pLayer.Name = "Duncan"
Dim pFeatureLayer As IFeatureLayer
pFeatureLayer = pLayer '********** Invalid cast exception is thrown here.
MsgBox(pFeatureLayer.Name)
What school boy error am I doing?Duncan