This might be a dumb question, but I just can't get this to work.
Using a 3rd party C# library, I need to get live data via an Event Handler, It goes something like this:
Library.KEvents bnoEvent = new Library.KEvents();
envtsList.Add(bnoEvent);
/*
Some code to set bnoEvent up
*/
bnoEvent.OnEvent += new Library._IKEventsEvents_OnEventEventHandler(bnoEvent_OnEvent);
The function bnoEvent_OnEvent
is never executing.
The demo code I got (in VB) looks like this:
If KEventsA Is Nothing Then
Set KEventsA = New Library.KEvents
End If
/* Setting KEventA up */
The method that is being called is:
Private Sub KEvents_OnEvent(data As KType)
This drives me CRAZY! I cannot find any connection between this function and the KEventA
object! How does it know?
I know it is pretty hard to debug without knowing how this library actually works, but is there any major things I should be doing while registering for events beside declaring the function and adding it as a new eventHandler?