C# and handling a COM event
a) create a class level version of the COM component i.e. EventTest1.clsMainClass evt = new EventTest1.clsMainClass();
[Note: example is a VB test event that I've created just to check the logic]
b) set up the event handlers, I found that if I started off with typing the object name, i.e. evt, then on typing . the intellisense would offer me the events as well, and if I selected one of those and type += then the rest of the information was available through intellisense (got to live intellisense)
i.e.
evt.OnComplete += new EventTest1.__clsMain_OnCompleteEventHandler(OnComplete);
evt.OnStart += new EventTest1.__clsMain_OnStartEventHandler(OnStart);c) create the event handler
i.e.
void OnStart(ref string text)
{
MessageBox.Show (text);
}void OnComplete(ref string text)
{
MessageBox.Show (text);
}And that is it, simple really...