为什么csimpleexception / cuserexception包含成员m_bautodelete和m_breadyfordelete,就像cexception一样?

发布于 2025-02-13 13:34:43 字数 596 浏览 2 评论 0原文

我只是在测试和调试一些代码,而我在一个源自cuserexception的例外类中挣扎。 cuserexception再次从csimpleexceptioncexception派生。

我知道cexception :: m_bautodeletecexception :: m_breadyfordelete的用法。

现在,我可以看到两个变量m_bautodeletem_breadyfordeletecsimpleexception再次定义。但是它们从未被使用,也从未初始化。真的很奇怪...

有人知道该变量在基类中重新定义的原因吗?

I was just testing and debugging some code and I struggled over a an exception class that was derived from CUserException. CUserException is again derived from CSimpleException and CException.

I know about the usage of CException::m_bAutoDelete and CException::m_bReadyForDelete.

Now I can see that those both variables m_bAutoDelete and m_bReadyForDelete are defined in CSimpleException again. But they are never used and never initialized. Real strange...

Does anybody know the reason that this variables are redefined in the base class?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

同尘 2025-02-20 13:34:43

我认为没有解决方案,也没有理由。

我将当前VS-2019 MFC代码与VC-6 MFC代码进行了比较。 AFX.H包含相同的未使用变量。

因此,我认为这是一个“错误”,因为“愚蠢的向后兼容性”从未解决的问题

I assume that there is no solution and not reason.

I compared the current VS-2019 MFC code with the VC-6 MFC Code. the afx.h contains the same unused variables.

So I assume it is a "bug" that what never fixed because of "silly backward compatibility"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文