Using events in Interface classes
Hi,
Is it possible to declare events in your interfaces? I want to use an interface class to provide a standard interface to my app. Here is an example of what I'm trying to do:
VB Code:
PublicNotCreateable Class MyInterface()
Public Event InterfaceEvent(parameter as Variant)
Public Sub InterfaceMethod()
'
End Sub
End Class
Public Class InterfaceImplemented()
Implements MyInterface
Private Sub MyInterface_InterfaceMethod()
MsgBox "This is an interface method"
End Sub
End Class
Public WithEvents MyObj as MyInterface
Private sub Form_Load()
Set MyObj = New InterfaceImplemented 'The error occurs here because
'vb says I haven't implemented the event.
'This is all very good and well, but how do I do that?
End Sub
The class declaration is just to show you the different classes. Thanks