events in interface definition ...
hi all the genius out there ...,
i am trying to develop a report engine like crystal report (something better ) ...for that i need to define a interface which has events .so that all the classes which implement this interface will also define the events ...i felt this is how the code should go ..
'interface interface1 ( i call this class interface1)
public event event1()
public function func1()
end function
'a class which implements this interface should be like this(I feel) ..
implements interface1
public event interface1_event1()
public function interface1_func1()
'some lines
'under some condition raise event1
end function
but this doesn't work because a event name cannot have a underscore .How to do this ?...
I want the events raised by this class which implements the interface to be recieved when the object is referenced through the interface (interface1) .
i.e
dim ob1 as Interface1
set ob1 = new class1 (the class which implements interface1)
'this above line would give a runtime error ...
ob1.func1() 'this would fire the event ...
'the event code
private sub ob1_event1()
end sub
'but this event cannot be recieved ..
i wish i could explain it better ...
do u have any solution or work arounds ...