I'm looking for a method or message that is always fired when an MFC Dialog (CDialog or CDialogEx) is getting destroyed.
I found the following messages which seem cause a dialogs destruction:
- WM_DESTROY
- WM_CLOSE
- WM_QUIT (not only for dialogs but to quit from the main message loop which causes destruction as well)
Together with those inheritable function which get called when a dialog closes but not always:
OnOk()OnCancel()
And I'm unsure about OnFinalRelease() as it seems to be something for OLE controls.
Is there a message or method always called or fired when a dialog gets destructed? I need to do some final heap cleanup on the destruction of my dialog instance.