Why Microsoft not provide for C# a static Win32 class with the most native functions and structures

Posted by Oleg on Stack Overflow See other posts from Stack Overflow or by Oleg
Published on 2010-05-08T00:52:46Z Indexed on 2010/05/08 0:58 UTC
Read the original article Hit count: 238

Filed under:
|
|
|
|

Everybody who used P/Invoke of Windows API knows a long list of declarations of static functions with attributes like

 [DllImport ("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]

The declaration of structures copied from Windows headers like WinNT.h or from web sites like www.pinvoke.net take also a lot of place in our programs.

Why we all have to spend our time for this? Why Microsoft not give us a simple way to include a line like in old unmanaged programs

#include <windows.h>

and we would be have access to a static class Native with all or the most Windows functions and structures inside?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET