Programming with Microsoft Foundation Class vs. Qt [freehackers.org]
Aug 7, 2002 — by LinuxDevices Staff — from the LinuxDevices Archive — viewsPascal Audoux shares his experiences programming with both the Qt and Microsoft Foundation Class (MFC) toolkits, in this article posted at freehackers.org that includes an english translation by Philippe Fremy. Audoux, already familiar with Trolltech's Qt graphical C++ toolkit, embarks on using the Microsoft's MFC graphical toolkit, which is part of an object oriented application framework based on the… win32 API, and supports both C and C++ development languages. Audoux writes . . .
” . . . The fundamental difference between Qt and MFC is their design . . . MFC is a kind of object wrapper allowing access to the windows API, which is written in C. This is not a good object oriented design. In many places, you must supply a C struct with 15 members but only one relevant to your case, or you must call functions with obsolete parameters.”
“And there are nasty tricks, without any consistency. For example, if you create a graphical object, it is not created until the Create() methods has been called. For dialogs, you must wait for OnInitDialog(), for views, you wait for OnInitialUpdate(), … So if you create an object manually and call its methods, your program crashes . . .”
“Qt is the opposite. The architecture is a good object oriented one and was obviously intelligently designed. The result is a toolkit very consistent regarding naming, inheritance, classes organisation and methods. Methods argument are the one you want to supply, no more. They always come in the same order for different classes. And the return value is logical. Everything is at the same time powerful and simple. Once you have used one of their classes, you can use many of them because they all work the same . . . “
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.