Hello Everyone,
I would like to know what does "afx" in MFC stand for and what is its significance.
Thanks in Advance.
Regards,
Ashwin
Printable View
Hello Everyone,
I would like to know what does "afx" in MFC stand for and what is its significance.
Thanks in Advance.
Regards,
Ashwin
Quote:
Originally Posted by AshwinRao
ActiveX
AfX
DirectX
and so on .....
Afx really means Application Framework , X is a fancy character added like other microsoft innovations :thumb: 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.. :D
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.Quote:
Originally Posted by AshwinRao
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.
good lesson....
But Why Afx is prefixed with global functions and constants? e.g. AfxMessageBox() .Quote:
Afx really means Application Framework
:wave:
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.Quote:
Originally Posted by upashu2
so if I get this, if I want to create a pure MFC application I better use AfxMessageBox then the normal MessageBox?
It depends:Quote:
Originally Posted by da_cobra
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.
- ::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().
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... :thumb:Quote:
Originally Posted by Andreas Masur
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.Quote:
Originally Posted by da_cobra
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?
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)...Quote:
Originally Posted by souldog
Nice to see you to.Quote:
Originally Posted by gstercken
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.