C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,411 questions
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