I'm curently working on dialogs in an MFC application and I'm – admittedly – quite new to MFC.
Let's say I have class A
(derived from CDialog
) that uses class B
(also derived from CDialog
). Thus, A::OnInitDialog()
calls the create(...)
method of B
.
I saw now that the destructor of class B contains
if ( GetSafeHwnd() )
{
DestroyWindow();
}
Is this okay? In my understanding it would be better to call B
's DestroyWindow()
method in A::OnDestroy()
. Is that right?
Thanks for your help!
Oliver