matlabit
matlabit

Reputation: 858

Use C++ dll from C#

I have a C# GUI, and a dll I compiled in matlab for C++. I would like to call from my C# code to the dll functions. I tried first to convert the C# code to CLI, but then saw it is not recommended. Can I create one solution with 2 projects - one the C# GUI and one - wrap the c++ dll with C++ code and call it from the C# ?

Any reference will be appreciated.

Thanks

Upvotes: 1

Views: 397

Answers (1)

Illia Tereshchuk
Illia Tereshchuk

Reputation: 1202

You can use C++ dll's in C# by using [DllImport] attribute, it is described in this MSDN thread.

Upvotes: 2

Related Questions