I have created a dialog (class derived from CDialog) and having one OK button in it.Problem is sometimes dialog dont get close in one go when ok button is pressed.I have debugged the code ,destructor of dialog class is getting properly called,I have also used OnDestroy() method and ON_WM_DESTROY() message.