包装类C ++。NET中? [英] wrapper class for C++ in .net?

查看:121
本文介绍了包装类C ++。NET中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C ++项目。我想将它移植到C#.NET项目。我做了一些研究,我觉得最流行的方法是使用的PInvoke。

I am having a C++ project. i would like to port it to a C#.NET project. I have done some research and I think the most popular way is to use pinvoke.

我不知道是否还有存在其他的方法?

I dont know whether there are also other methods existed?

感谢。

推荐答案

好了,普通的P / Invoke好与C接口,但如果你想与一些真正的C ++代码互操作,你将不得不使用一些更复杂。在.NET中,可以使用C ++ / CLI。在Mono上.NET你可以使用:

Well, plain P/Invoke is good to interface with C, but if you want to interop with some real C++ code, you would have to use something more sophisticated. With .NET, you can use C++/CLI. On Mono on and .NET you can use:

痛饮

第一个选项是欠成熟,但似乎更优雅。

First option is less mature but seems to be more elegant.

这篇关于包装类C ++。NET中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆