J
Jeff Molby
This is blowing my mind. For some reason, A.Save() always calls A.Update().
Shouldn't it call B.Update() when the object is instantiated as a B? I've
been working with these classes for some time now, override methods without
any sort of problem, but for some reason this one just isn't working right.
Does it have something to do with the way I'm using the interface? Thanks
for any and all help!
Jeff
Interface Z
Sub Save()
End Interface
Class A
Implements Z
Public Sub Save() Iimplements Z.Save
Update()
End Sub
Protected Overridable Sub Update(Optional Byval ZeroRowsOK as boolean =
false)
'Does Stuff
End Sub
End Class
Class B
Inherits A
Protected Overrides Sub Update(Optional Byval ZeroRowsOK as boolean =
false)
'Does different stuff
End Sub
End Class
Class CallingClass
Public Shared Main()
Dim x As New B()
UtilityFunction(x)
End Sub
Sub UtilityFunction( i As Z)
i.Save()
End Sub
End Class
Shouldn't it call B.Update() when the object is instantiated as a B? I've
been working with these classes for some time now, override methods without
any sort of problem, but for some reason this one just isn't working right.
Does it have something to do with the way I'm using the interface? Thanks
for any and all help!
Jeff
Interface Z
Sub Save()
End Interface
Class A
Implements Z
Public Sub Save() Iimplements Z.Save
Update()
End Sub
Protected Overridable Sub Update(Optional Byval ZeroRowsOK as boolean =
false)
'Does Stuff
End Sub
End Class
Class B
Inherits A
Protected Overrides Sub Update(Optional Byval ZeroRowsOK as boolean =
false)
'Does different stuff
End Sub
End Class
Class CallingClass
Public Shared Main()
Dim x As New B()
UtilityFunction(x)
End Sub
Sub UtilityFunction( i As Z)
i.Save()
End Sub
End Class