您的位置:首页 > 其它

OnInitDialog()和对话框的构造函数的区别

2010-06-11 18:28 519 查看

对于这个问题关键是它们针对的对象不同:

构造函数主要针对的是C++的类对象的成员变量的初始化,是内在的,而OnInitDialog()主要针对的是与类对象相关联的windows窗体上控件的初始化问题,是外在的。

在MSDN中微软是这样说的:

Commonly Overridden Member Functions of Class CDialog

Member function Message it responds to Purpose of the override

OnInitDialog WM_INITDIALOG Initialize the dialog box's controls.

OnOK BN_CLICKED for button IDOK Respond when the user clicks the OK button.

OnCancel BN_CLICKED for button IDCANCEL Respond when the user clicks the Cancel bu
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: