CObject类别 [英] CObject Class

查看:99
本文介绍了CObject类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么CObject是大多数MFC类的基类?

Why is CObject the base class for the majority of MFC classes?

推荐答案

您的问题的重点是什么?
您是否在问一个单一的根类层次结构的有用性?
您是在问CObject是否适合MFC根类吗?
还是担心作为根类 name 的" CObject "?
:)
What is the point of your question?
Are you asking about the usefulness of a single rooted classes hierarchy?
Are you asking if CObject fits well as MFC root class?
Or are you worried about "CObject" as root class name?
:)


简单的答案-不是.

答案为为什么Microsoft认为在MFC中从CObject派生(几乎)所有内容是一个好主意?"可能他们当时认为这是个好主意.

早在1991年,他们必须使用的C ++实现是一个相当老练的C ++编译器(没有模板,名称空间和异常),CObject的某些功能确实是在克服功能的缺乏和使用C ++的经验.这包括诸如动态创建和基类指针收集类之类的内容.

干杯,

Ash
Simple answer - it''s not.

The answer to "why did Microsoft think it was a good idea in MFC to derive (almost) everything from CObject?" is probably that they thought it was a good idea at the time.

Back in 1991 the C++ implementation they had to play with was a pretty unsophisticated C++ compiler (no templates, namespaces and exceptions) and some of the features of CObject were really to overcome the lack of features and lack of experience of using C++. This includes things like dynamic creation and base class pointer collection classes.

Cheers,

Ash


这有什么区别*-为什么* CObject是最终的基类.就是这样,您无能为力.
What difference does it make *-why* CObject is the ultimate base class. It simply is, and there''s nothing you can do about it.


这篇关于CObject类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆