Use C ++ dll from C #

I have C # GUI and dll compiled in MATLAB for C ++. I would like to call from my C # code in a dll function. At first I tried to convert C # code to CLI, but then I saw that it was not recommended. Can I create one solution with two projects - one from the C # GUI and one - wrap a C ++ dll with C ++ code and call it from C #?

Any link would be appreciated.

thank

+1
source share
1 answer

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

+2
source

Source: https://habr.com/ru/post/1588925/


All Articles