Using VC++ 6.0 (MFC exe), I made an automation program. It runs successfully (word document created) in Release version but in Debug version, it works fine and closes but 500 lines of first chance exceptions are shown :
(First-chance exception in AutoProject.exe (KERNEL32.DLL): 0x800706BA: (no name))
Any expert can guide me w.r.t the error I have made.

In OnOK()
{//run the program
OnClose(); //wherein deleting some pointers & calling CDialog::OnClose() at the end
OnCancel();//calls DestrotWindow Fn wherein "return CDialog:estroyWindow();"
}