[英]Why would I want to use managed (C# and .NET) or native code for Windows API development?
As a developer learning Windows API programming, what are some reasons why I should use native code, and what are some reasons why I should use managed code? 作为学习Windows API编程的开发人员,我应使用本机代码的原因有哪些,为什么应使用托管代码的原因有哪些?
The assumption is that I am equally familiar with both types of development for non-Windows API programming. 假定我同样熟悉非Windows API编程的两种开发类型。
.NET : Productivity, ease of development. .NET :生产力,易于开发。 Some APIs are missing and need to be imported using PInvoke
缺少某些API,需要使用PInvoke
导入
Win32 API in C++ : All APIs are available. C ++中的Win32 API :所有API均可用。 Sometimes they are much harder to use because the underlying complexity is not hidden behind .NET classes. 有时它们很难使用,因为基础复杂性并未隐藏在.NET类的后面。
generally, it all depends on the amount of control you need, and the amount of time you have to get something done. 通常,这取决于您需要的控制量以及完成某项工作所需的时间。
you can do things very quickly using the .NET framework, as most of the functionality is built in (albeit cookie-cutter type stuff). 您可以使用.NET框架快速完成操作,因为大多数功能都是内置的(尽管有cookie-cutter类型的东西)。
you'd use unmanaged C++ apps using MFC if you need an extremely high level of control over the application and how it reacts to certain events. 如果您需要对应用程序及其对特定事件的反应进行极高级别的控制,则可以使用通过MFC使用的非托管C ++应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.