I know VB6 is known for having poor OOP support but basic polymorphism appears to work (at least for Subs, Functions and Properties), however my problem is that I can't work out how to raise events from the inherited classes.
I have 3 classes - clsBase, clsInheritedA, clsInheritedB.
In clsBase I have:
CODE
Option Explicit
Public Event TestEvent()
Public Sub Initialise()
End Sub
Public Property Get Initialised() As Boolean
End Property
etc.
And I want to raise the TestEvent event from clsInheritedA:
CODE
Option Explicit
Implements clsBase
Private Sub TestRaiseEvent()
RaiseEvent TestEvent
End Sub
Private Sub Initialise()
'do something
End Sub
Private Property Get Initialised() As Boolean
'do something
End Property
etc.
But it gives me "Event not found" on the "RaiseEvent TestEvent" line when I try to compile it.
Does anyone know what I am missing to let the inherited class raise the events of the base class so that the host application can then respond to those events (i.e. TestEvent) when it has done:
CODE
Private WithEvents clsTest as clsBase
Then later:
CODE
Set clsTest = New clsInheritedA
Thanks in advance for any help.
This post has been edited by adw888: 26 Jul, 2008 - 09:34 AM