Thread: MFC Tutorial or Info?

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    6

    MFC Tutorial or Info?

    Hey everyone,

    I've been going through SAM's Teach Yourself C++ in 21 days, and in the 2 weeks of work I've went through, nowhere did it mention MFC's. Now, to tell the truth I'm not even really sure what they are, but I see them mentioned everywhere and I feel I should learn about them too.

    So what it boils down to, is I need some links or other types of resources to help me learn about MFC's. Thank you

    -------MaTrIxXx-------

  2. #2
    Comment your source code! Lynux-Penguin's Avatar
    Join Date
    Apr 2002
    Posts
    533
    MFC - Microsoft Foundation Classes
    its a bunch of C++ classes to make designing windows applications easier. For more information on MFC get a book:
    Begining Visual C++ 6.0 by Ivor Horton
    also as a personal note:
    I think MFC is stupid. It's a lazy person's way out of going the long and PROPER way. I hate the idea that you have to either link the static library or pray that the machine it runs on has the dynamic library on it. If you want immediate information try google's search

    but then again, I am the guy who hates Java to the core (and uses it -_-) and I avoid using classes as much as possible.

    -LC
    Last edited by Lynux-Penguin; 08-05-2003 at 01:17 PM.
    Asking the right question is sometimes more important than knowing the answer.
    Please read the FAQ
    C Reference Card (A MUST!)
    Pointers and Memory
    The Essentials
    CString lib

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Originally posted by Lynux-Penguin
    MFC - Microsoft Foundation Classes
    its a bunch of C++ classes to make designing windows applications easier. For more information on MFC get a book:
    Begining Visual C++ 6.0 by Ivor Horton
    also as a personal note:
    I think MFC is stupid. It's a lazy person's way out of going the long and PROPER way. I hate the idea that you have to either link the static library or pray that the machine it runs on has the dynamic library on it. If you want immediate information try google's search

    but then again, I am the guy who hates Java to the core (and uses it -_-) and I avoid using classes as much as possible.

    -LC
    I think MFC is a useful tool. It lacks some of the power of the WinAPI, but it's not designed to replace the whole WinAPI. It's designed to allow very rapid development of programs using "common" GUI components. I can write and debug a complete simple MFC application in a few hours; I've written three or four development tools in a day before, when I've had to.

    To make a vehicle analogy, MFC is like a coupe -- it isn't as powerful as other vehicles, but it can get you where you want to go, and it can do most common tasks with relative ease. Not the kind of car you'd use if you wanted a lot of power, but it's easy to handle and fast.

    The WinAPI is like a semi -- it can do whatever you want it to, it has power galore, but it's not as quick and doesn't handle as well as the coupe. It's harder to learn to drive, although its power makes it worth it if you NEED that power. You don't get to your destination as fast as with the coupe, but you can do more.

    Are both useful? Sure. I wouldn't want to move furniture from coast to coast in a coupe, but I also don't want to take a semi to the grocery store for milk.

    As to classes -- they're the core of C++ and OOP, to not use them is to not reap the vast benefits of OOP. Encapsulation, inheritance, polymorphism, etc. are very powerful and versatile tools, and if you're writing anything more advanced than "Hello World", I'd use classes. In fact, even if I don't use MFC, I usually roll my own window classes, designed for efficiency and designed for the task at hand. OOP is a way of thinking, and once you think in OOP terms, you can tackle even huge programs without much trouble.

    Further, you can always include the MFC .DLL (and any other libraries you dynamically link) with the executable you distribute; there's no guesswork at all involved in using some form of installer manager and telling it to include the .DLL.

    There are plenty of very well-established companies which develop applications using primarily MFC; it's not a bad tool. I recommend learning the WinAPI, but knowing and using MFC as well. Like all tools, there isn't a one-size-fits-all supertool. Some applications are best written using MFC, some best written using MFC and WinAPI, and some best written using WinAPI alone. The more tools you have at your disposal, the faster and easier you can accomplish your programming goals.
    Last edited by Cat; 08-05-2003 at 04:54 PM.

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    245
    www.codeguru.com is Microsoft's approved site for all things VisualC++, including MFC. There's even a link to Codeguru.com on Microsoft's website.

    Now, I've looked at MFC and learned parts of it. I'm not happy at it's attempts to make better building blocks for the WindowsAPI, and so I prefer Borland C++ Builder for small projects (Cat's coupe) and Visual C++ without MFC for larger projects. In either case however, I like to use classes for as much code as I can, simply for the reason of being able to manage it easier - I find it a lot easier to have a class with a few variables local to that class by making them private, than doing a non-class program and making them global to the entire file. It just seems cleaner to me, and makes some things (adding multiple document support to a recent single-document-only project, for example) incredibly easy.

  5. #5
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    I moved away from the Borland camp a while ago; they (at the time) had zero Unicode support, and porting an ANSI app to Unicode was a huge effort for me. Plus, I got Visual Studio Professional very, very cheap.

    Having used Borland's OWL and Microsoft's MFC, I like MFC better. Plus, it's the more widely used in industry, which is something to consider when learning new skills. C++ Builder may well be as good as MFC, but I don't think Borland has tools to write programs for WinCE, which I have needed to do, so I used MFC.
    Last edited by Cat; 08-05-2003 at 04:57 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. Question about getting an info class from another Form
    By Joelito in forum C# Programming
    Replies: 0
    Last Post: 10-16-2006, 01:02 PM
  3. Problem with tutorial (Vector class)
    By OdyTHeBear in forum C++ Programming
    Replies: 4
    Last Post: 12-18-2002, 02:49 PM
  4. Beyond MFC : COM || Networking
    By kuphryn in forum Windows Programming
    Replies: 5
    Last Post: 04-25-2002, 04:28 PM
  5. Understanding The Future of MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 04-15-2002, 09:08 PM