Andrew wrote:
I wanted to know what is the best or cleanest way to fire an event from a dll
to the app that is using the dll in vb.net 2.0.
Description:
The dll will call or fire an event called “MyEventName(“Info to pass”)”
every 60 seconds. I want the app the process the event with the information
that I pass through the event
I am not sure exactly how this is done.
This is the model I use, basedon the little I know of how Our Friends in
Redmond want us to deal with events these days.
Class Z
Public Event Tick( ByVal sender as Object, ByVal e as TickEventArgs )
Public Class TickEventArgs
Private Sub New()
End Sub
Friend Sub New( ...arguments... )
End Sub
. . .
End Class
Protected Sub OnTick( e )
RaiseEvent Tick( Me, e )
End Sub
End Class
Then, in the calling program:
WithEvents timerZ as New Z
Private Sub timerZ_Tick( _
ByVal sender as Object _
, ByVal e as TickEventArgs _
) Handles timerZ.Tick
End Sub
HTH,
Phill W.