Use C++ dll from C#

假如想象 提交于 2019-12-24 15:26:30

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/20823551/use-c-dll-from-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!