Saturday, February 19, 2011

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

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

From stackoverflow
    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)

  • There is a related discussion here.

  • Or

    Create a COM wrapper and then reference it from .NET

0 comments:

Post a Comment