如何将一个项目在VC ++中转换为C# [英] how to one project convert in VC++ to C#
本文介绍了如何将一个项目在VC ++中转换为C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的先生
如何将项目VC ++转换为C#.Net
任何免费工具?
解决方案
否。
无论如何,它非常非常不可能产生好的代码:C ++基于指针,C#限制使用指针不安全
仅代码。
如果C ++项目已经是.NET,那么你可能会勉强使用它,并且是经过精心编写的 - 但我不会对它进行任何下注!
我会手动执行 - 但即使在那里你也必须要理解它们C ++和C#相当不错!
假设你的VC ++项目不是用户界面项目,你应该让这个DLL在VC ++旧版本中,最好的解决方案就是在C ++类上创建一个包装类您希望在C#和.NET中扩展。
这是MDSN链接 [ ^ ]
Dear Sir
How to convert project VC++ to C#.Net
any free tools ?
解决方案
No.
And it is very, very unlikely to produce good code anyway: C++ is heavily pointer based, where C# restricts the use of pointers tounsafe
code only.
It is possible - barely - that you might get away with it if the C++ project is .NET already, and was carefully written - but I wouldn't put any bets on it!
I would do it manually - but even there you are going to have to understand both C++ and C# pretty well!
Supposing that your VC++ project is not user interface project, you should let that DLL in VC++ old version and the best solution is create a wrapper classes over the C++ classes that you want to extend in C# and .NET.
Here is a MDSN Link[^]
这篇关于如何将一个项目在VC ++中转换为C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文