[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 636
  • Last Modified:

Raising Events from a class library

I am in a scenario where I have made a class library (*.dll) file.
At some point I need to raise an event( from within a class of the *.dll library) of a class(Like Event in the Class shown Below) which is outside or out of the scope of the *.dll library. How do I do it?
Do I need to add interface in that particular class of the *.dll library and implement in the calling class or any technique?
Does anybody have some idea?

Public Class SomeClass

         Public Event SomeEvent
..........

End Class
0
biplavo
Asked:
biplavo
  • 2
  • 2
1 Solution
 
Priest04Commented:
In order to call SomeEvent, you would need to have a reference to an object of SomeClass type, or to create a new one.

Goran
0
 
biplavoAuthor Commented:
I didnot understand quite precisely.
Could you please illustrate withan  example ?
0
 
Hawkvalley1Commented:
In you form where you will call it do this:
'Form_Load event
Dim sc As New SomeClass
AddHandler sc., AddressOf
'make a sub named the same as
Private Sub
   ' do stuff
End Sub
0
 
Priest04Commented:
Yes, that was what I meant. You should call it the same way as you call button click event. If this class is in external dll, add reference to this dll first.
0
 
Hawkvalley1Commented:
I answered the question completely and correctly. Shouldn't I get some points?
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now