Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

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?

Thanks
0
KalluMama
Asked:
KalluMama
4 Solutions
 
nonubikCommented:
>or should i wait until I have learnt Classes
Correct
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.

0
 
DanRollinsCommented:
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
0
 
Jaime OlivaresCommented:
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.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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....
0
 
DanRollinsCommented:
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 :-)
0
 
CmdrRickHunterCommented:
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.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now