MFC is Challenging :: C++

kuphryn

Senior member
Jan 7, 2001
400
0
0
Hi.

I posted a topic regarding GUI programming using C++ a week ago. I was wonder about the best tool to learn GUI programming using C++. Most members said MFC is the best tool to for GUI programming in Windows because of it is from Microsoft. However, many members said Qt is a much easier, and ultimately, more practically GUI tool in windows.

I bought a MFC book by Jess Prosise and I read the first chapter. I want to said MFC is challenging. First, I like the idea of having inherance and virtual functions and classes to control every specefic GUI feature. However, I am overwhelmed with the number of MFC classes and derived classes. There are too many classes to remember! There is not no way to really know the classes, their member functions, and the parameters for member functions.

I thought it over and decided to try Qt. From its interface, Qt look much easier than MFC because the GUI items are manageable via drag-drop. The negative side I Qt is *expensive*. It is too expensive (~$2k). Secondly, I do not think the free version Qt 2.3 is not Visual C++ .NET compatible.

Now I am basically left with MFC. Yes, it is intimidating me right now. I do not have problems with OOP. I am very comfortable with STL and enjoy using it to improve whatever I work on. MFC is different. Prosise present MFC as though I have to know everything about it as well as how Windows programs work. MFC is challenging to learn and implement at first.

Does it get easier and *faster*?

I am seriously considering using Borland C++ Builder. It has the RAD feature and I believe the GUI programming is similar to Qt. At least they look similar (drag-drop).

Kuphryn
 

Mucman

Diamond Member
Oct 10, 1999
7,246
1
0
Borland Builder is king when it comes to RAD (IMHO). It's been a long time since I have used it though. I had to do an assignment using MFC and I had no clue what I was doing :). I did well on the assignment but I had no clue all that went on to finish the program... I hear that MFC is widely used by tool programmers so I want to get more educated with it though...

I don't think that helps in any ways, but at least it is a bump for ya ;)
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Hi, an easy way to get started is to create a "dialog-based" project (MFC AppWizard (exe) > dialog based). This creates a simple application that at startup opens a dialog as the GUI for the program. You can resize the dialog and drag-drop controls onto it. You can learn some of message handling and UI building without having to learn about the view and doc classes.

But yes, once you've worked with MFC for awhile the app, frame, document and view classes do become easy to remember and work with. And no, there is just too much there for you to memorize every class member function -- that's what Help is for :) .
 

ermular

Member
Dec 24, 2001
143
0
0
http://www.winprog.org

LEARN win32 api before using MFC or you will up a creek with a stick for a paddle...

mfc is a wrapper for win32 api, and if you don't understand the inner working you will be clueless if you need to do some more techniques later on. if you're just talking about gui design, the visual c++ gui editor is fine; code should be done by you.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126


<< LEARN win32 api before using MFC or you will up a creek with a stick for a paddle.... >>


I'd phrase this as "learn win32 api as part of mastering MFC..."

Yes, MFC (and .Net's UI classes) are wrappers around win32, and everyone should own a copy of Petzold's "Programming Windows," but you can go pretty far towards learning MFC before you need to understand all of the details it is hiding from you. Just like you can use the STL / C++ standard library without knowing exactly how they wrote the string class.
 

kuphryn

Senior member
Jan 7, 2001
400
0
0
Thanks.

I will definitely stick with MFC. I find it challenge, but one can easily master MFC with a lot of intensive reading, GUI design and MFC implementation. I will approach it that way.

I like MFC because it is from Microsoft. If I am going to design programming for Microsoft windows using C++, I might as well master a tool that is designed by the developers behind the OS for the OS.

Kuphryn
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I like MFC because it is from Microsoft. If I am going to design programming for Microsoft windows using C++, I might as well master a tool that is designed by the developers behind the OS for the OS.

Maybe it's just me, but I feel the opposite way =) I'd rather use a GUI toolkit that's easy and lets me work fast and concentrate on the program I'm doing more than how to work the GUI.

Knowing MFC and the Win32 API isn't necessarily a bad thing (as long as you plan on staying with Windows...) but I don't see the reasoning behind wasting all the time on the GUI toolkit when there are ones that work just as well and are so much easier to use.
 

Damascus

Golden Member
Jul 15, 2001
1,434
0
0


<< I like MFC because it is from Microsoft. >>



MFC is evil because its parent is evil. ;) In all honestly, I think MFC sucks...
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126


<< In all honestly, I think MFC sucks... >>

from a technical standpoint or because MS is evil? From a technical standpoint MFC does an excellent job of placing Windows message handling into a class framework, the document-view architecture works well for most apps (and can be ignored if you don't want it), ClassWizard really speeds up development, and some of the classes like CString are quite useful. Having used MFC for 6.5 years now I have no major complaints about its worth for creating Windows apps.

Actually, I do have one, that MS stopped supporting cross-development to Mac OS as part of their strategy to keep Mac OS as a fake competitor to Windows. MS wanted Apple to survive but not to thrive well enough to threaten Windows, and keeping MFC apps from moving easily to Macs was part of that strategy. So after VC4 they just dropped the cross-development tools and libraries.
 

kuphryn

Senior member
Jan 7, 2001
400
0
0
Thanks everyone.

I hear two sides including MFC is bloated and MFC is powerful once the developer learns its working. Both sounds valid.

One thing I see is MFC developers like MFC, while developers that user other GUI tools and/or are in the process of learning MFC seem criticize it. Both situations are understandable.

As I this topic reads, I find MFC challenging mainly because there are many specific "tweaks," which are difficult for a beginner to learn, design around, and implement.

As I said before, I will definitely go through this process and learn MFC. I will give all I got into Prosise book. My goal is to first finish reading the book. My goal is to gain as much insight as I possibly can throughout the process. It will take some time, but very doable.

Are there some tips you have for gaining the most insights as possible during the process of learning MFC? I learning C++ quick. I can certainly apply the same technique I used throughout the process of learning C++.

Thanks,
Kuphryn