简体   繁体   English

为什么我要使用托管(C#和.NET)或本机代码进行Windows API开发?

[英]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.

相关问题 为什么我宁愿使用本机dll或com服务器从C#调用Delphi代码? - Why would I rather use a native dll or com server to call Delphi code from C#? 我将如何使用将本机代码与C#中的多个从属库包装在一起的C ++ / CLI dll? - How would i use a C++/CLI dll that wraps native code with multiple dependent libraries in C#? Windows窗体,Visual Studio C# - 为什么我应该/应该使用设置窗口而不是保存在文件中? - Windows Forms, Visual Studio C# - Why would/should I use a settings windows instead of saving in a file? 为什么要使用.NET编译器的调试模式? - Why would I want to use the debug mode of the .NET compiler? 如何在C#.net web开发中使用skype API - How to use skype API in C# .net web development 在Windows CE的托管C#代码中加载本机DLL作为调试模块 - Loading Native DLL as Debug Module in Managed C# Code for Windows CE 如何从托管代码项目中调试本机代码项目? C++/C# - How do I debug a native code project from inside a managed code project? C++/C# 我想在unity的通用windows平台的开发中使用windows runtime API - I want to use windows runtime API in the development of unity's universal windows platform 构建c#MVC asp.net api网页-我想使用index.cshtml页面,但收到失败消息:CS1980(代码说明请参见文本) - Building c# MVC asp.net api webpage- I want to use the index.cshtml page but get the failure message: CS1980 (see text for code description) 在.NET Compact Framework中的托管代码(C#)中使用非托管(C)缓冲区 - Use unmanaged(C) buffer in managed code(C#) in .NET Compact Framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM