Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Why functions _cexit, _c_exit, exit and _exit do not work in debug mode?

Why functions _cexit, _c_exit, exit and _exit do not work in debug mode?

Scheduled Pinned Locked Moved C / C++ / MFC
helpvisual-studiodebuggingtutorialquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Arris74
    wrote on last edited by
    #1

    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.

    M 1 Reply Last reply
    0
    • A Arris74

      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.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Which one do you need to use?  They al perform differently. MArk

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      A 1 Reply Last reply
      0
      • M Mark Salsbery

        Which one do you need to use?  They al perform differently. MArk

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        A Offline
        A Offline
        Arris74
        wrote on last edited by
        #3

        I use _c_exit() It allows me to exit from a procedure/process without closing the application.

        M 1 Reply Last reply
        0
        • A Arris74

          I use _c_exit() It allows me to exit from a procedure/process without closing the application.

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          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:

          A 1 Reply Last reply
          0
          • M Mark Salsbery

            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:

            A Offline
            A Offline
            Arris74
            wrote on last edited by
            #5

            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?

            M 1 Reply Last reply
            0
            • A Arris74

              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?

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              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:

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups