CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13
  1. #1
    Join Date
    Apr 2005
    Posts
    247

    What does afx in MFC stand for??

    Hello Everyone,
    I would like to know what does "afx" in MFC stand for and what is its significance.

    Thanks in Advance.
    Regards,
    Ashwin

  2. #2
    Join Date
    Aug 2004
    Location
    INDIA
    Posts
    260

    Re: What does afx in MFC stand for??

    Quote Originally Posted by AshwinRao
    Hello Everyone,
    I would like to know what does "afx" in MFC stand for and what is its significance.

    Thanks in Advance.
    Regards,
    Ashwin

    ActiveX
    AfX
    DirectX
    and so on .....

    Afx really means Application Framework , X is a fancy character added like other microsoft innovations directX,ActiveX..

    You can see this X plays a important role to draw attention not only in microsoft... in other area too..
    sample

    XXX
    Xtreme Programming
    you can add more..
    Last edited by santoct2002; May 30th, 2005 at 02:47 AM.
    If you feel this post is useful,
    Rate this Post by clicking right top corner (Rate this Post)
    Santhosh

    ***Add strength to your country - Interesting Poll
    ***

  3. #3
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: What does afx in MFC stand for??

    Quote Originally Posted by AshwinRao
    I would like to know what does "afx" in MFC stand for and what is its significance.
    The first version of MFC has started being developed in 1989 by a group at Microsoft known as the application framework technology development goup - known as the AFX group.
    According to a widespread belief, AFX stands for "Application Framework eXtension". According to George Sheperd and Scot Wingo, however, the legend goes like this: "AF" didn't sound so great by itself, to they added "X" to get a three-letter acronym. The X doesn't really mean anything.

    It's significance? Well, you will encounter Afx as a prefix for some functions and constants in MFC. It's significance is purely historical - it shows us how they called the framework internally, before it shipped under the name MFC 1.0 in 1992.

  4. #4
    Join Date
    May 2005
    Posts
    32

    Re: What does afx in MFC stand for??

    good lesson....

  5. #5
    Join Date
    Apr 2005
    Location
    Mumbai,India
    Posts
    185

    Re: What does afx in MFC stand for??

    Afx really means Application Framework
    But Why Afx is prefixed with global functions and constants? e.g. AfxMessageBox() .

    Life is what u make it and u can make it more simple..........and woderful.
    Rate is what give and it give me pleasure.


  6. #6
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: What does afx in MFC stand for??

    Quote Originally Posted by upashu2
    But Why Afx is prefixed with global functions and constants? e.g. AfxMessageBox()
    At that time, namespaces were not yet part of the C++ standard. They needed a way to generally distinguish MFC globals from symbols in the SDK API - hence the prefix.

  7. #7
    Join Date
    Apr 2005
    Posts
    151

    Re: What does afx in MFC stand for??

    so if I get this, if I want to create a pure MFC application I better use AfxMessageBox then the normal MessageBox?

  8. #8
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: What does afx in MFC stand for??

    Quote Originally Posted by da_cobra
    so if I get this, if I want to create a pure MFC application I better use AfxMessageBox then the normal MessageBox?
    It depends:
    • ::MessageBox() requires the window handle of the parent window. And since it's a C function, there are no default parameters, so you always have to pass all five parameters.
    • With CWnd::MessageBox(), you already don't need the parent HWND parameter. Besides that, the second and third parameter (caption and type) have default values, so you can call it passing only the text.
    • AfxMessageBox() is the global MFC version - it doesn't need the parent window either (it will always use the app's main window). And since it's also a C++ function, it has default parameter values like CWnd::MessageBox().
    So back to your question: It is not "better" to use AfxMessageBox(), it's only simpler, since you need to specify less arguments. Generally, there's nothing wrong with calling any Win32 API function from MFC code - but calling the MFC counterparts is usually easier.

  9. #9
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: What does afx in MFC stand for??

    One other advantage of using 'AfxMessageBox()' that comes ins handy especialliy while dealing with multi-language resources is the ability of passing in a string table ID which will automatically be loaded...

  10. #10
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: What does afx in MFC stand for??

    Quote Originally Posted by Andreas Masur
    One other advantage of using 'AfxMessageBox()' that comes ins handy especialliy while dealing with multi-language resources is the ability of passing in a string table ID which will automatically be loaded...
    Good point...

  11. #11
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863

    Re: What does afx in MFC stand for??

    Quote Originally Posted by da_cobra
    so if I get this, if I want to create a pure MFC application I better use AfxMessageBox then the normal MessageBox?
    I for one never understand this kind of statement. What does it mean to write a pure MFC application and why do people worry about that kind of thing.
    AfxMessageBox eventually just calls ::MessageBox.

    Am I the only one who has replaced all the CString wrappers for this kind of thing with std::string?
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  12. #12
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: What does afx in MFC stand for??

    Hi Soul, nice to see you again...

    Quote Originally Posted by souldog
    Am I the only one who has replaced all the CString wrappers for this kind of thing with std::string?
    Probably yes. I only know people who did it the other way round (that is, porting CString to a non MFC / non Windows environment)...

  13. #13
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863

    Re: What does afx in MFC stand for??

    Quote Originally Posted by gstercken
    Hi Soul, nice to see you again...

    Probably yes. I only know people who did it the other way round (that is, porting CString to a non MFC / non Windows environment)...
    Nice to see you to.

    Just seems to me that since I already have a portable string class in std
    it is much easier to write the handful of global functions related to resource loading and window text. Plus it just made me feel pretty nifty.
    It is just a question of taste however.
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

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

Featured