Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MFC dialog based application exit code

280 views
Skip to first unread message

Ivan

unread,
Jan 30, 2003, 12:47:07 PM1/30/03
to

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?

Thanks in advance.

Regards,
Ivan

Jeff Partch

unread,
Jan 30, 2003, 12:55:51 PM1/30/03
to
"Ivan" <iva...@hotpop.com> wrote in message
news:01ef01c2c887$9b5feb50$d2f82ecf@TK2MSFTNGXA09...

Try overriding CWinApp::ExitInstance and returning whatever value you want.

--
Jeff Partch [VC++ MVP]

0 new messages