Reputation:
How can I call a C++ function from C# .NET?
Upvotes: 3
Views: 369
Reputation: 24561
Or
Create a COM wrapper and then reference it from .NET
Upvotes: 0
Reputation: 89232
compile the C++ function into a dll and use P/Invoke
or
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)
Upvotes: 6