Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tough question on WPF, Win32, MFC

Tags:

wpf

winapi

api

mfc

Let's suppose you're an IT student with a basic knowledge of C++ and C#. Let's suppose that you want to design apps that:

  1. need to deliver some performance like archivers, cryptographic algorithms, codecs
  2. make use of some system calls
  3. have a gui

and you want to learn an Api that will enable you to write apps like those described earlier and:

  1. is mainstream
  2. is future proof
  3. entitles you to find a decent job
  4. is easy enough - I mean easy like VCL, not easy like winapi

So, making these assumptions, what Api will you choose? MFC, WPF, other? I really like VCL and QT, but they're not mainstream and I think few employers will want you to write apps in QT or Visual C++ Builder...

Thanks for answers.

like image 537
Mack Avatar asked Mar 20 '10 21:03

Mack


People also ask

Does WPF use Win32?

WPF and Win32 Interoperation BasicsHost WPF content in a Win32 window. With this technique, you can use the advanced graphics capabilities of WPF within the framework of a standard Win32 window and application.

What is Win32 and MFC?

1.Win32 is also known as the Windows API while the MFC is a C++ class library that wraps parts of the Windows API. 2.The MFC consists of the most common operations used in building a Win32 application. 3.Using the MFC makes the coding lighter and a lot simpler than using the Windows API directly.

Is WPF a framework?

Windows Presentation Foundation (WPF) is a UI framework that creates desktop client applications. The WPF development platform supports a broad set of application development features, including an application model, resources, controls, graphics, layout, data binding, documents, and security.

What is WPF architecture?

WPF is a next-generation UI framework to create applications with a rich user experience. It is part of the . NET Framework 3.0 and higher. WPF has a rich and extensible architecture for designing rich UI applications.


1 Answers

Note: The following answer was written several years ago with Desktop application development in mind. Today (in 2018), you'd probably just build a web application to end up with something reasonably cross-platform and device-independent. (For example, using ASP.NET Core on the server side, coupled with a UI framework/library such as React, Vue.js, or Angular on the client side).

  • Win32 API -- I'd forget about it, if I were you. Programming a Windows application directly via the Win32 API only makes sense if you're programming in pure C, or if you really need to do a lot of system calls, or if you're concerned about the additional overhead introduced by more "comfortable" platforms or frameworks (such as the ones named below). Programming UIs directly through the Win32 API is tiresome, messy, and you need to deal with lots of details. It's also not platform-independent at all, but you may or may not be concerned about that.

  • MFC -- Perhaps an option if you're programming in C++ and fixed on the Windows platform. I never understood what's so great about it, other than it makes the Win32 API much more comfortable (AFAIK it's basically a collection of object-oriented wrappers around the Win32 API that take away some of it's complexity / messyness). Also, it's also not very platform-independent.

  • Qt, wxWidgets -- Fairly widespread UI frameworks. Might be good options where platform independence plays a role. AFAIK both frameworks are targeted at the C++ language.

  • WinForms (.NET) -- Similar to MFC, this is also based on the Win32 API (USER32 and GDI+). AFAIK the WinForms framework is now being ported to Mono, and therefore somewhat cross-platform. However, it's not exactly the most up-to-date technology. For complex UIs it can also be somewhat sluggish sometimes. If I had to decide today which framework to use, I'd rather choose...:

  • WPF (.NET) -- More modern than WinForms, with more graphical capabilities and, apparently, faster rendering, as it is no longer based on the Win32 API (GDI). (And it runs on .NET, which I find a great platform to develop for. Programming in C# is so much easier than programming in C++ IMHO, which is also an argument against Win32 API, MFC, Qt, and wxWidgets.) Note that WPF is not cross-platform, it exists only on the Windows platform so far.

  • Then of course there's Java, including the UI frameworks that come with it. I can't say much about that since I'm not a Java person, but I could imagine that Java would be the best choice for platform independence; and it's the dominant platform (over .NET) in certain industries (e.g. mobile phones, banking, due to the very solid JVM and security considerations).

So my recommendation would be the .NET framework, and WPF for the UI, if you're planning to stay mostly in the Microsoft world. Remember that you can still use the Win32 API (you won't come closer to "system calls" than that) via P/Invoke.

like image 117
stakx - no longer contributing Avatar answered Oct 10 '22 02:10

stakx - no longer contributing