How do I implement my class ClsInterface
, which has this code:
Public Function add(x As Integer, y As Integer) As Integer
End Function
in my class Class2
, which has this code:
Implements ClsInterface
Public Function add(x As Integer, y As Integer) As Integer
add = x + y
End Function
My test code is
Public Sub test()
Dim obj As New Class2
MsgBox obj.add(5, 2)
End Sub
This always comes up with the following error:
Microsoft Visual Basic
Compile error:Object module needs to implement 'add' for interface 'ClsInterface'
OK/Help
but there is no help on Microsoft help (when I press on Help button).
Any Ideas?