You have to set up a delegate which is basically a declaration of the function prototype for your "event_raising_code" function. Then you define an event of that delegate type so that your caller can add a handler for that event. Like so:
public class YourCSharpClass { public delegate void ProcessMessage(YourMessageType msg); public event ProcessMessage OnNewMessage;
public void DoIt() { YourMessageType msg = null; while((msg = Server.ReadMessage()) != null) { if(OnNewMessage != null) OnNewMessage(msg); } } }
In your VB code you just use withevents or AddHandler to subscribe to the Event OnNewMessage with a sub that has one parameter of type YourMessageType.
-- SvenC
|