
MFC dialog based application exit code
Quote:
> Dear all,
> I'm developing an MFC dialog based application. I am
> having problem about the exit code. If the OK button is
> executed by clicking the mouse, the exit code is 0. But if
> the OK button is executed by pressing the keyboard (Enter
> or spacebar) the exit code is 1. I thought that there's
> something wrong with my code. So I generated a fresh
> dialog based (MFC) application and write no additional
> code to it, the result is the same.
> Is it possible to set the exit code to 0?
Try overriding CWinApp::ExitInstance and returning whatever value you want.
--
Jeff Partch [VC++ MVP]