Win32 API and MFC

This is a discussion on Win32 API and MFC within the C++ Programming forums, part of the General Programming Boards category; Sorry if this is a stupid question but i have looked all over the place and have not found a ...

  1. #1
    Call me AirBronto
    Join Date
    Sep 2004
    Location
    Indianapolis, Indiana
    Posts
    195

    Win32 API and MFC

    Sorry if this is a stupid question but i have looked all over the place and have not found a solid awnser.

    What is the difference between Win32 API and MFC. I heard a while ago that MFC is an extention of Win32 API that has a structure more C++ friendly, but i am not sure please help.

  2. #2
    Occasionally correct Mr.OC's Avatar
    Join Date
    Oct 2004
    Posts
    6
    Try this; http://www.winprog.org/tutorial/apivsmfc.html

    That explains well enough what the differences are. Hope it helps.


  3. #3
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    MFC is an acronym for Microsoft Foundation Classes. It's a wrapper for Win32 API, so basically you have a bunch of classes that supposedly make it faster, easier and neater to create Windows applications. Of course, that means you'll have to learn how to use the MFC classes, and learn to program within its structure.

    I've never used MFC, so I don't know the details of how it works. From my personal opinion though, I prefer to use plain Win32 API, simply because I prefer to know what goes on 'under the hood'. It's quite messy though, until you start to figure out how to structure your program properly, and perhaps start making wrapper classes of your own. Using MFC, the structure is pretty much laid down for you, and you fill in variables/add code to functions so that it does what you want - and you end up with an application that looks and works great.

    As a note, wherever I see quick GUI applications that people wrote to interface with hardware gadgets that they've built, they all use MFC. Perhaps I just haven't found them, but I've never seen one that uses plain Win32 API.

    Just remember, there's no real 'wrong' choice - once you've learned one, you can always go back and learn the other. In fact, you might even be able to learn both at the same time; I'm pretty sure you can do a little mixing of MFC and API, as long as you're careful about it and know what you're doing.

    **Edit**
    Doh, beaten by Mr. OC Good article, it makes some good points.
    Last edited by Hunter2; 12-03-2004 at 11:06 AM.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    470
    I find programming in MFC easier than the winapi. For almost any MFC class it's possible to get the underlying winapi variable. But in most cases that's pointless. The MFC methods are usually like the winapi ones but shorter.

  5. #5
    Call me AirBronto
    Join Date
    Sep 2004
    Location
    Indianapolis, Indiana
    Posts
    195
    Thanks alot for the solid Answers, it really helped. But now i have another question, dose any one out there have any suggestions on books that teach Win32 API well, i mean really really well.

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    To start, Programming Windows by Charles Petzold. It's THE book on Win32 programming. After that I can warmly recommend Programming Applications for Microsoft Windows by Jeffrey Richter, which gives invaluable in-depth knowledge about how Windows works.

    If, then, you're still interested in learning MFC, Programming Windows with MFC by Jeff Prosise is the MFC equivalent of Programming Windows, IMHO. Before that I completely shunned MFC, now I can understand that some people want to work with it
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  7. #7
    Call me AirBronto
    Join Date
    Sep 2004
    Location
    Indianapolis, Indiana
    Posts
    195
    Thanks Alot

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Win32 API or Win32 SDK?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 07-20-2005, 03:26 PM
  2. OLE Clipboard :: Win32 API vs. MFC
    By kuphryn in forum Windows Programming
    Replies: 3
    Last Post: 08-11-2002, 05:57 PM
  3. Thread Synchronization :: Win32 API vs. MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 08-09-2002, 09:09 AM
  4. Is it foolish to program with Win32 API ?
    By Kelvin in forum Windows Programming
    Replies: 2
    Last Post: 07-09-2002, 02:03 PM
  5. WIndows programming?
    By hostensteffa in forum Windows Programming
    Replies: 7
    Last Post: 06-07-2002, 08:52 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21