Hard question about WPF, Win32, MFC

Suppose you are an IT student with basic knowledge of C ++ and C #. Suppose you want to create applications that:

  • some performance needs to be provided, such as archivers, cryptographic algorithms, codecs
  • use some system calls
  • eat gui

and you want to learn Api, which will allow you to write applications like the ones described earlier, and:

  • is the main theme
  • is future proof.
  • gives you the opportunity to find a decent job
  • simple enough - I mean easy as VCL, not as simple as winapi

So, having made these assumptions, what will Api choose? MFC, WPF, others? I really like VCL and QT, but they are not basic, and I think that few employers will want you to write applications in QT or Visual C ++ Builder ...

Thanks for answers.

+7
api winapi wpf mfc
source share
2 answers
  • Win32 API . I would forget about it if I were you. Programming a Windows application directly using the Win32 API makes sense only if you are programming in pure C or you really need a lot of system calls, or if you are worried about the extra overhead introduced by more "convenient" platforms or frameworks (for example, named below). Programming user interfaces directly through the Win32 API is tedious, messy, and you need to deal with a lot of details. It is also platform independent, but you may or may not worry about it.

  • MFC Perhaps this is an option if you are programming in C ++ and fixed on the Windows platform. I never realized what was good about this, except that the Win32 API is much more convenient (AFAIK is basically a collection of object-oriented wrappers around the Win32 API that take up some of the complexity / clutter). In addition, it is also not very platform independent.

  • Qt , wxWidgets . Pretty common user interface interfaces. There may be good options when platform independence plays a role. AFAIK both structures are oriented to the C ++ language.

  • WinForms (.NET) . Like MFC, it is also based on the Win32 API (USER32 and GDI +). AFAIK in WinForms is now ported to Mono and, therefore, somewhat cross-platform. However, this is not the most advanced technology. For complex user interfaces, it can sometimes be somewhat sluggish. If I had to decide today which framework to use, I would prefer to choose ...:

  • WPF (.NET) is more modern than WinForms, with more graphical features and, apparently, faster rendering, since it is no longer based on the Win32 API (GDI). (And it works on .NET, for which I find an excellent development platform. C # programming is much simpler than C ++ IMHO programming, which is also an argument against the Win32 API, MFC, Qt, and wxWidgets.) Please note that WPF is not cross-platform, it exists only on the Windows platform.

  • Then, of course, Java , including the user interface interfaces that come with it. I cannot say much about this since I am not a Java person, but I could imagine that Java would be the best choice for platform independence; and it is the dominant platform (over .NET) in certain industries (e.g. mobile phones, banking, due to very solid JVMs and security concerns).

So my recommendation is the .NET framework and WPF for the user interface if you plan to stay mostly in the Microsoft world. Remember that you can still use the Win32 API (you cannot get closer to the "system calls") through P / Invoke.

+10
source share

If you like coding in C # and working with a .Net card, I would recommend you take a look at WPF. WPF is a great GUI infrastructure where you can do anything and make it shine! WinForms might be easier to understand, but I would say that WPF is more "future proof". Another positive thing: WPF is really similar to Silverlight , so if you do a great job with WPF, you can also write Silverlight applications - if that's interesting. Please do not bother learning MFC .. I can’t believe that many of them use MFC today for other reasons than they used to, and did not get the opportunity to change.

There are many good jobs for .Net programmers, so the ability to process some GUI frameworks in addition to C # and general knowledge of the .Net infrastructure will be useful.

When it comes to the fact that you can "deliver some performance, such as archivers, cryptographic algorithms, codecs," it really should not depend on your choice of graphical interface. This type of code will be written to layers outside the graphical user interface layer and is usually associated with a graphical interface. With WPF, you will write, for example, cryptographic algorithms in C # in a certain class that are not dependent on the GUI level, and then the presentation written in WPF will contact the C # code and get an answer from here. However, if you used WinForms, you will still do the same, and the performance depends on the algorithms, and not on the GUI.

When it comes to getting started with WPF, there are many questions about how SO helps with this. Therefore, you should find good help with a quick search.

Good luck

+5
source share

All Articles