tags:

views:

214

answers:

3

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

+5  A: 
  1. compile the C++ function into a dll and use P/Invoke

    or

  2. compile the C++ function into a C++/CLI assembly, wrap in a managed C++ class, and then treat like any other assembly (add a reference, use a using statement and call the class)

Lou Franco
A: 

There is a related discussion here.

itsmatt
A: 

Or

Create a COM wrapper and then reference it from .NET

Nemanja Trifunovic