Hi all,

i read that the .net framework is a wrapper around the win32 api.

can someone please clarify the following for me:

1.if .net is a wrapper around win32 api it means we are able to do everything with .net that we used to do with win32 api. then why we still need the p/invoke to the win32 api? (i understand that p/invoke can be used with other non windows api as well)

2.what are the limitations (in terms of programming) of .net compared to win32 api ?

1.if .net is a wrapper around win32 api it means we are able to do everything with .net that we used to do with win32 api. then why we still need the p/invoke to the win32 api?

Because there's not a .NET interface to all of the Win32 API. For some things you still need to call into the Win32 API through PInvoke. Accessing the message loop directly or "low level" windowing features, for example.

2.what are the limitations (in terms of programming) of .net compared to win32 api ?

Due to the abstraction of .NET, there can be performance issues. In such cases optimization techniques include dropping to a lower level with PInvoke or writing high performance pieces in something like C++.