MFC dialog based application exit code 
Author Message
 MFC dialog based application exit code

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



Mon, 18 Jul 2005 18:47:07 GMT  
 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]



Mon, 18 Jul 2005 18:55:51 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MFC Dialog-based applications return code

2. Unexpected exit of a Dialog base application

3. Unexpected exit of a dialog base application...

4. Adding Another MFC Dialog to the Dialog base application

5. return a value when an MFC dialog-based app exits

6. Exiting An MFC Application From Code

7. Return code from dialog based application

8. Dialog based MFC application problem

9. dynamic drawing with dialog based MFC application

10. How to enable/disable Toolbar button in Dialog Based MFC application

11. in MFC dialog based application call Win32 Dll fail

12. dialog based MFC app. application file types

 

 
Powered by phpBB® Forum Software