Results 1 to 14 of 14

Thread: API n MFC

  1. #1

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    API n MFC

    hi all!!

    i was wondering where to put this thread.......but since i am also talking about API n am regular member of VB in this forum so i posted it here.

    i need to submit a small synopsis on API V/s MFC . it should be about 5 pages long. can neone help with any link etc??

    thnx

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: API n MFC

    MFC is only used in C++ so you should post this question in the C++ forum.

  3. #3

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: API n MFC

    yeah but API is used in VB so can you help me with that asap??
    i will post the same for mfc in vc++ section.

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: API n MFC

    What exactly do you need? I would think the differences would be obvious. MFC is a framework with which to build applications apon, while API is just a way to bypass limited functionality. Meh, basically.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  5. #5
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: API n MFC

    But you wanted a synopsis on API vs MFC, which means you need a comparison between using the two so this is a pure C++ question. If you have any specific API question there is an API forum in here as well, even though that is more about using the API in VB.

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: API n MFC

    Quote Originally Posted by chemicalNova
    What exactly do you need? I would think the differences would be obvious. MFC is a framework with which to build applications apon, while API is just a way to bypass limited functionality.
    That is not really true. Well it's true that the MFC is a C++ framework but stating that the API is built to bypass limited functionality is a completely wrong statement. Even though we VB users might look at the API that way the API has existed long before VB was invented.

    The Windows Application Programming Interface is the base Windows is built on and, before newer RAD tools like VB was made, the only way you would build programs on Windows. The API was created mainly for C developers in mind and are a huge function library. The base of the origional API was built into 3 different files, Krnl386.dll, GDI.dll, and User.dll (these files was then renamed to Kernel32.dll, GDI32.dll, and User32.dll on the Win32 platform). The GDI file contains all graphical functions used to draw windows and controls on the screen. The User file contains all Keyboard and Mouse functions and handles input/output. While the Kernel file contains functions to handle memory and to create processes.

    These are the origional base of Windows and its API and Windows will not work without them. However today there are many more files that handles what is still called the base API, such as Winsock.dll, Winspool.dll, Advapi32.dll and so on.

    The Microsoft Foundation Classes (MFC) are basically reusable C++ classes that are wrapped around the API functions and has been called "the new API".
    Last edited by Joacim Andersson; May 12th, 2005 at 07:04 AM. Reason: spell checking

  7. #7
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: API n MFC

    I know this is true, but he said we use it in VB, and as such, I stated it as a VB Programmer would. I use both MFC and API on a regular basis, and I used API alot during my C days (and quite a bit now aswell, in 32-bit assembly).

    Now I look at it, I did sound quite "noob" in my above post..

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  8. #8
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: API n MFC

    Quote Originally Posted by chemicalNova
    Now I look at it, I did sound quite "noob" in my above post..
    LOL, yeah I wonder what grade Harsh Gupta would have got if he turned in a paper that stated that the "API is made to bypass limited functionality in some languages like for example VB" .

  9. #9
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: API n MFC

    Quote Originally Posted by chemicalNova
    What exactly do you need? I would think the differences would be obvious. MFC is a framework with which to build applications apon, while API is just a way to bypass limited functionality. Meh, basically.

    chem
    VB Code:
    1. For Each ThatStatement In ThisThread
    2.     Me.Remove(ThatStatement)
    3. Next
    I'm so embarassed now

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  10. #10

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: API n MFC

    hi all!!

    actually i need to present a small presentation n its documentation describing about API n MFC, their advantages, disadvantages (adv/disadv over each other etc) just to explain wot is the fuss about them n their vast use in vb n vc++ respectively. e.g. api hepls in optimising the code to some extent etc... all i need is some theoritical explaination.

  11. #11

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: API n MFC

    i even posted it in c++ section but to no avail?!?!?!

  12. #12

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: API n MFC

    plz some one help.......i couldn't find nething theoritical on the net....neither on API nor MFC

  13. #13
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: API n MFC

    Why do you get such an assignment if you don't know anything about it? Anyway, I wont write a 5 pages paper for you but here are a short summit.

    As already mentioned MFC is a framework or rather a large class library for C++ developers that develop for the Windows platform. The MFC are mainly convenient wrappers around the Windows API. The advantage of the MFC is the fact that they are classes with everything that comes with that in a true OOP language. You can inherit from them and add functionality.

    They are also better organized compared to the API functions. The APIs are organized into different DLLs however when you use them you might not care or even know in which DLL they exist so from the developers view point the API isn't organized at all, while the MFC is organized into different classes that inherit from each other. One class also have several methods and each method could correspond to one API function.

    The MFC has been extended over the years and new versions have been released over the years. That is also an disadvantage since you might need to distribute the rather large MFC library with your application to be sure they run on each version of Windows. Another disadvantage with using the MFC instead of the API is that since many of the MFC classes and their methods simply are wrappers and internally calls the API function they may be slower to use then calling the APIs directly.

    So in short....
    Advantage of using the MFC over the API includes:

    1. MFC are better organised in classes.
    2. You can easily extend a MFC class through inheritance.
    3. Ease of use

    Disadvantage includes:

    1. Distribution. You might need to include the rather huge MFC library with your application.
    2. Speed. Calling an API function directly might be faster then letting a class method call it for you.

    Now to fill up a 5 page paper I would include some code examples that do the same thing, one using the MFC and one using the API.

  14. #14

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: API n MFC

    thnx JA, i think i can elaborate it myself now. thnx again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width