Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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.
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.


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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 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