Improve company productivity with a Business Account.Sign Up


What I need to learn before MFC?

Posted on 2004-09-09
Medium Priority
Last Modified: 2013-11-20
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?

Question by:KalluMama
LVL 16

Assisted Solution

nonubik earned 200 total points
ID: 12018934
>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.

LVL 49

Accepted Solution

DanRollins earned 400 total points
ID: 12023160
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
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 200 total points
ID: 12023586
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.
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Author Comment

ID: 12026400
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....
LVL 49

Expert Comment

ID: 12035633
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 :-)

Assisted Solution

CmdrRickHunter earned 200 total points
ID: 12037309
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.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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.

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…

585 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question