Closing via Console generates non-zero exit code

  • Thread starter Thread starter Peter Oliphant
  • Start date Start date
P

Peter Oliphant

I have a C++ Console application being written using VS C++.NET 2005
Express. It never crashes and seems to be working just fine.

However, when I close the application via the Console 'X' exit button in
upper right corner of its dialog box I get the following exit code:

"The program '[1576] MyApplication.exe: Managed' has exited with
code -1073741510 (0xc000013a)."

If I close it via the 'X' in the application form it exits with exit code 0:

"The program '[872] Thonks.exe: Managed' has exited with code 0 (0x0)."

To repeat, nothing goes wrong ever. But the return of an non-zero exit code
usually means something isn't quite right.

As an added bit of info that could easily be part of this oddity, when the
'X' in the application form is clicked I capture the interrupt and fade out
the form. Thus, when using this method of closing the form exists for a
while after the exit button has been hit. This is not the case when exiting
via the Console, this exits immediately. Thus, Im thinking the timer I use
to close the form may be complaining (although not sure how a close via
Console goes thorough the exit procedure)...

Should I be worried about anything? : )

[==P==]
 
Peter Oliphant said:
I have a C++ Console application being written using VS C++.NET 2005
Express. It never crashes and seems to be working just fine.
Cool.

However, when I close the application via the Console 'X' exit button in
upper right corner of its dialog box I get the following exit code:

"The program '[1576] MyApplication.exe: Managed' has exited with
code -1073741510 (0xc000013a)."

Take a look at <winnt.h> or <ntstatus.h>. That is the value assigned to the
manifest constant STATUS_CONTROL_C_EXIT. I think that the runtime is just
choosing to end your program with the code to note the user's cancel
operation.

Regards,
Will
 
Back
Top