The exception I get is an access violation ( 0x0000005) in MFC42.dll.
I believe it is because of some pointer becoming NULL and me trying to access it.

The PreTranslateMessage(...) does not get the message, but through the child windows, it reaches the OnCommand() function.

This is where I destroy the window and it seems like the message gets relayed back to the child windows and they crash....


Is there a way I can make sure that the message does not get relayed back...
since this is a window close event, can I write some code in the OnCommand() function itself that will make sure that my window gets completely destroyed and there is no message relayed back....