Reputation: 8613
I'm currently working on a project in .NET that communicates with native C++ libraries through the use of a C++/CLI project. However, moving forward with this project, I would like to be able to expose specific modules of the native C++ code, preferably with as little extra implementation as possible, while maintaining re-usability and scalability.
I've done some research into both uses, but cannot work out which would be better for solving this purpose. Could someone explain which approach is best suited to this scenario, if any?
Upvotes: 1
Views: 1378
Reputation: 43311
If you want to wrap native C++ code for .NET, use C++/CLI. For simple C-style API it is possible to use PInvoke.
If you want to wrap native C++ code both for .NET and COM clients (like Internet Explorer, MS Office, scripting languages etc.), use COM.
To my opinion, writing COM wrapper is more complicated task. But COM guru can have another opinion - it depends on your experience in these technologies.
Upvotes: 2