11,572 questions
Define and pass the delegate. sample can be found here.
https://www.codeproject.com/Tips/393817/Pass-Csharp-Delegate-as-Callback-to-Cplusplus
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
what I want to do is use a dll which write in c++.
I want to pass an event-handler or a method to the dll and when it run the dll will call the event-handler.
function my_func()
{
Console.WriteLin("i am called");
}
[DllImport("my-dll.dll")]
public extern static registerFunc();
Define and pass the delegate. sample can be found here.
https://www.codeproject.com/Tips/393817/Pass-Csharp-Delegate-as-Callback-to-Cplusplus