0

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?

The assumption is that I am equally familiar with both types of development for non-Windows API programming.

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
merlin2011
  • 71,677
  • 44
  • 195
  • 329
  • The question is asked with the assumption that I already understand the answer to that question. This one is specifically about Windows API development. – merlin2011 May 23 '12 at 05:24
  • Ideally, I'd like some examples of cases where .NET would be easier and cases where native would be necessary. – merlin2011 May 23 '12 at 17:26

2 Answers2

3

.NET: Productivity, ease of development. Some APIs are missing and need to be imported using PInvoke

Win32 API in C++: All APIs are available. Sometimes they are much harder to use because the underlying complexity is not hidden behind .NET classes.

wilx
  • 17,697
  • 6
  • 59
  • 114
  • +1 nice answer. But as MFC-developer i can say: it isn't very hard to use. It may be boring, yep, because you _have to_ read too much MSDN docs. But `(boring && long) != hard`, i think. – Raxillan May 23 '12 at 06:00
2

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).

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.

Mike Corcoran
  • 14,072
  • 4
  • 37
  • 49