cdialog中的析构函数 [英] Destructors in cdialog

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

问题描述

大家好,

我在重新整理基于对话框的对话框时遇到问题.

如果我使用vs向导创建基于cdialog的对话框,则该向导不会为新创建的对话框声明ctor.
如果我使用vs向导创建一个类,则该向导将创建一个空的虚拟ctor.

为什么这两种情况有这样的区别?
我不应该为基于cdialog的类声明ctor,而只能通过重写ondestory或其他函数(哪个函数?)来删除成员变量.

谢谢

dj4400.

Hi all,

I have a question regrading cdialog based dialogs.

If i create a cdialog based dialog with the vs wizard, the wizard doesnt declare a ctor for the newly created dialog.
If i create a class with the vs wizard, the wizard creates an empty virtual ctor.

Why there is such a difference between the 2 cases?
Am i not supposed to declare a ctor for a cdialog based class and only delete member variables by overriding ondestory or some other function (which function?)

Thanks

dj4400.

推荐答案

对不起,我有些困惑...我写了ctor而不是dtor ...这是固定的问题:

大家好,
我在重新整理基于对话框的对话框时遇到问题.
如果我使用vs向导创建基于cdialog的对话框,则该向导不会为新创建的对话框声明 dtor .
如果我使用vs向导创建了一个类,则该向导会创建一个空的虚拟 dtor .

为什么这两种情况有这样的区别?
我不应该为基于cdialog的类声明 dtor ,而仅通过重写ondestory或其他函数(哪个函数)来删除成员变量.
谢谢
dj4400.
Excuse me i got a bit confused... i wrote ctor instead of dtor... here is the fixed question:

Hi all,
I have a question regrading cdialog based dialogs.
If i create a cdialog based dialog with the vs wizard, the wizard doesnt declare a dtor for the newly created dialog.
If i create a class with the vs wizard, the wizard creates an empty virtual dtor.

Why there is such a difference between the 2 cases?
Am i not supposed to declare a dtor for a cdialog based class and only delete member variables by overriding ondestory or some other function (which function?)
Thanks
dj4400.


这篇关于cdialog中的析构函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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