I'm updating some old Managed C++ code with lines like this:
instanceOfEventSource->add_OnMyEvent(
new EventSource::MyEventHandlerDelegate(this, MyEventHandlerMethod) );
where
- EventSource is the class that publishes events
- instanceOfEventSource is an instance of that class
- EventSource::MyEventHandlerDelegate is the delegate type for the event
- MyEventHandlerMethod is a (non-static) method within the current class (of which "this" is an instance) with the signature matching EventSource::MyEventHandlerDelegate
What is the right syntax for this in C++/CLI?
See Question&Answers more detail:os