I have defined a delegate and event in the class like this:
public delegate void ResponseHandler();
event ResponseHandler^ responseEvent;
and then from a class method, I fired event as:
someAsyncFunction().then([this]()
{
responseEvent();
});
From another place, I subscribed to the event as:
mWebServiceComponent->responseEvent += ref new WebServiceComponent::ResponseHandler([this]() { });
But, this is not working and application raises an exception while calling the responseEvent. The exception is:
"Unhandled exception at 0x50CB9AD1 (msvcr110d.dll) in WWAHost.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.
If there is a handler for this exception, the program may be safely continued."
This is really driving me crazy. What is wrong with this code? Could some please help!!
Thanks in advance.