how to pass method handle to dll?

mc 5,186 Reputation points
2023-10-09T09:20:26.4466667+00:00

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();
C#
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
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.