How can I call a C ++ function from C #?

How can I call a C ++ function from C # .NET?

+3
source share
2 answers
  • compile C ++ function in dll and use P / Invoke

    or

  • compile the C ++ function into a C ++ / CLI assembly, wrap it in a managed C ++ class and then process it like any other assembly (add a link, use the using statement and call the class)

+6
source

or

Create a COM wrapper, and then reference it with .NET.

0
source

Source: https://habr.com/ru/post/1699452/


All Articles