Inheritence and Interfaces.

  • Thread starter Thread starter Elephant
  • Start date Start date
E

Elephant

Hello,

is it possible to inherit a class and give it an interface and then let the
interface methods point to the methods from the base class?

class BaseClass
....
end class

interface MyInterface
....
end interface

class ComeTogether
Inherits BaseClass
Inherits MyInterface
...
REM point the MyInterface members ( with same name ) to BaseClass
members.
end class

I want to create a BaseClass, and a class that derrives from that BaseClass.
The derrived class must get a COM interface, but this COM interface must
also expose some of the BaseClass methods.

Any Ideas?

Thank you,

Me.
 
Try:

Public Interface MyInterface
Sub MyMethod()
End Interface

Public Class BaseClass
Public Sub MyMethod()

End Sub
End Class

Public Class DerivedClass
Inherits BaseClass
Implements MyInterface

Private Sub MyImplementedMethod() Implements MyInterface.MyMethod
MyBase.MyMethod()
End Sub

End Class

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 
Back
Top