how to use c++ dll in c# project?

Ashwin picture Ashwin · Oct 17, 2011 · Viewed 17.1k times · Source

Possible Duplicate:
Using C++ Class DLL in C# Application

I try to failed to add reference to add c++ dll in c#

if you have any other method to add or use c++ dll in c#. how can we use?

Where do i mistake to add dll in my c# project?

Thanks in advance

Answer

Doc Brown picture Doc Brown · Oct 17, 2011

For using native C++ libraries in C#, you mostly will have to create a C++/CLI wrapper for that. P/Invoke is ok as long as the API of your DLL contains just simple C-like functions, but when the API contains real C++ classes, C++/CLI ist much better for that task.