Why functions _cexit, _c_exit, exit and _exit do not work in debug mode?
-
Hello, The following functions _cexit, _c_exit, exit and _exit works fine on release mode but in debug mode the processes/procedures are not terminated when the functions are called. I use VS 2003 and I use both managed and unmanaged code. Anyway I tried those functions with #pragma managed and #pragma unmanaged but the problem is the same. Do you know why and how to make them working on debug mode? Thanks for your help.
-
Hello, The following functions _cexit, _c_exit, exit and _exit works fine on release mode but in debug mode the processes/procedures are not terminated when the functions are called. I use VS 2003 and I use both managed and unmanaged code. Anyway I tried those functions with #pragma managed and #pragma unmanaged but the problem is the same. Do you know why and how to make them working on debug mode? Thanks for your help.
Which one do you need to use? They al perform differently. MArk
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Which one do you need to use? They al perform differently. MArk
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I use _c_exit() It allows me to exit from a procedure/process without closing the application.
Arris7 wrote:
I use _c_exit()
I'm not sure what you expect it to do... "Performs quick C library termination procedures and returns to the caller, but does not terminate the process." Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Arris7 wrote:
I use _c_exit()
I'm not sure what you expect it to do... "Performs quick C library termination procedures and returns to the caller, but does not terminate the process." Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Mark, Sorry for the confusion, I am not clear with my problem. Let me give an example. Suppose the user of my application type-in some data from within an edit control. This calls a function which calls a 2nd function and finally a 3rd function is called. But the 3rd function rejects the data entered by the user. It returns a message to the user. The user clicks on OK and finally gets the hand on the application. So the unique solution I've found is _c_exit() that terminates the procedure and gives the hand to the application without closing it. But is does not work in debug mode. Any idea?
-
Mark, Sorry for the confusion, I am not clear with my problem. Let me give an example. Suppose the user of my application type-in some data from within an edit control. This calls a function which calls a 2nd function and finally a 3rd function is called. But the 3rd function rejects the data entered by the user. It returns a message to the user. The user clicks on OK and finally gets the hand on the application. So the unique solution I've found is _c_exit() that terminates the procedure and gives the hand to the application without closing it. But is does not work in debug mode. Any idea?
I think you may be misunderstanding what these functions are for. They are not for flow control in function calls. They are for exiting a process (i.e. a running application). Simple error codes returned from your functions will allow the caller to take the appropriate action based on the value it gets back from a called function. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: