Adding an Event Handler.

I've got some code embedded in a class as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
Reader::Listen(CSource* source)
{__hook(&ReadEvent::NewTagReceived,source ,&Reader::SerialPortManagerDataReceived);}

Reader::StopListen(CSource* source)
{__unhook(&ReaderEvent::NewTagReceived,source,&Reader::SerialPortManagerDataReceived);}

SerialPortManagerDataReceived(LPCWSTR data)
std::wstring store=data;
if(store.length() == 23)
{
     __raise source->NewTagReceived(data);
}


Now I'm writing the Program.Cs and I wish to use these functions. The problem is I can't figure out how to create an EventHandler.

I've notice that event by definition has a _AddEventHandler option but I can't find any documentation on how to use it.
Topic archived. No new replies allowed.