What I need to learn before MFC?

I am new to C++ and MFC, I have taken a community college course in C++ where the last thing we learnt was functions, now i am taking the next class where I will be learning classes, OOP etc.

My question is...can I start learning MFC with this limited knowledge, or should i wait until I have learnt Classes and other more advanced C++ concepts before diving into MFC?

Who is Participating?
One thing about MFC is that it is nicely integrated into the VisualStudio IDE development environment with its very useful Wizards that generate a lot of the code for you.

That means that with a few clicks, you can create a program that actually does something visible on the screen.   For my money, being able to display a dialog box and have something happen when you click a button in it (say, display a message box) is 1000 times more satisfying than the console-based stuff they teach in C++ 102.

The inner workings of MFC are deeply OOP and probably beyond your current level, but just like the fact that people drive cars without knowing how they work, you can use VC/MFC to "get somewhere" without needing to understand its complexities.

So my recommendation is to "play around" with Microsoft VC++ and MFC... maybe just enough so that you can use your new C++ skills as you learn them.

-- Dan
>or should i wait until I have learnt Classes
MFC stands for Microsoft Foundation Classes. The Microsoft Foundation Class Library is an application framework for programming in Microsoft Windows. Written in C++, MFC provides much of the code necessary for managing windows, menus, and dialog boxes; performing basic input/output; storing collections of data objects; and so on. All you need to do is add your application-specific code into this framework. Given the nature of C++ class programming, it is easy to extend or override the basic functionality that the MFC framework supplies.

Jaime OlivaresSoftware ArchitectCommented:
Although you can work with MFC with minimal classes knowledge, I think you have to learn classes first to do anything different to simply cut and paste examples from the internet.
MFC is strongly related to classes, countersense to WinAPI, also could be a good idea to learn some of WinAPI befor MFC to know what it happening at the "internals" of MFC.
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

KalluMamaAuthor Commented:
So what I gather from this is that I atleast need some basic Classes knowledge before trying MFC. Since i trying to make some changes to a small existing application, are there any other things that I should know before working with an application written using MFC? Coz right now when i look at the code it looks absolutly foreign to me...this is after having a basic C++ class....
MFC is all about pre-written class objects --- just classes that you would have to write yourself if somebody else hadn't already done it.  So the real source of information is MSDN which provides a full diescription of each of these pre-written classes.  

If you are working with somebody else's code and you see an object named, for instance CMyDlg, then go to the header file for that class and see that it is derived from CDialog.  Put the cursor on the word CDialog and press the F1 Key.  That's how to learn MFC :-)
Knowing what a class is, and having some idea of the syntax will help quite a bit.  It will also help to know something about dynamic memory allocation (using new and delete), but its not always necisary.

My advice would be to go to Boarders or Barnes and Noble, grab a teach yourself C++ book (or similar), and read their chapters on the basics of classes, and how to derrive classes.  Then read their section on dynamic memory.  Don't worry if you dont actually understand it, what is more important is that you have at least seen the concepts in a "teaching" usage before being thrown into MFC.  It will help you quite a bit when you see CMyDialog: public CDialog   and you actually comprehend what is going on there.

Then follow examples... find tutorials, and just poke around.  Dont worry, no matter how you learn MFC, you'll have to unlearn half of it when you learn the proper way to do it, but its okay... its the process.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.