Question about Firing and event from a dll

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.

Were can I find information about this?
 
Andrew said:
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.
 
Back
Top