AFX前缀的意义

AFX小组成立于1989年,由微软公司创建,旨在为Windows应用程序开发者提供C++对象导向工具。起初,AFX试图创建跨平台解决方案,但最终转向专注于Windows,并发展为MFC框架。AFX中的'X'并无特殊含义,只是流行后缀。MFC库中包含以afx开头的函数和宏,用于简化Windows程序开发,部分函数可被API替代。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


微软AFX

成立时间

1989年

成立公司

微软公司

团队

ApplicationFramework技术团队,名为AFX小组,用以开发C++对象导向工具给Windows应用程序开发人员使用。

AFX中的X

AFX 的"X"没有什么意义,是比较流行的结尾字符,如activex等。

当小组成员以此产品开发应用程序,他们发现实在是太复杂,又悖离公司的主流系统--Windows --太遥远。于是他们修改宪章变成"deliver the power of object-oriented solutions to programmers to enable them to build world-class Windows based applications in C++." 这差不多正是Windows 3.0异军崛起的时候。以afx开头的函数不能说是MFC的 全局函数,而是MFC的类函数。当初这个小组打算建立一个可以跨linux和windows平台的设计软件,结果失败了,遗留了大量的函数以afx命名,最终用类的概念建立了MFC的框架,所以现在MFC之中有很多afx函数,这些函数可以用API函数替代。AFX 小组预期MFC 的使用者不可能人人皆为C++ 专家,所以他们并没有采用所有的C++高阶性质(例如 多重继承)。许多「麻烦」但「几乎一成不变」的Windows程序动作都被隐藏在MFC 类别之中, 例如WinMain、RegisterClass、Window Procedure 等等等。


MSDN中的解释。 


MSDN中,关于AFX前缀的描述。只在MFC章节,《宏、全局函数、全局变量》一节。表示MFC里面的全局函数和全局变量,大部分都是用了AFX前缀,只是没有提到AFX工作组,也没有提到AFX是什么缩写,实在是有点遗憾。还是网络的资料提供比较全面,也算是一些野史吧。

Macros, Global Functions, and Global Variables

The topics in this section provide descriptions of the global functions, global variables, and macros in the MFC library.

Note   Many global functions start with the prefix "Afx" — but some, such as the dialog data exchange (DDX) functions and many of the database functions, deviate from this convention. All global variables start with the prefix "afx". Macros do not start with any particular prefix, but they are written all in uppercase.

The MFC library and the Active Template library (ATL) share string conversion macros. SeeString Conversion Macros in the ATL documentation for a discussion of these macros.

For information on the debug version of the C run-time library and diagnostic functions, seeDebug Routines, in the Run-Time Library Reference.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值