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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Program exited with code 2 (0x02). What does it mean?

Program exited with code 2 (0x02). What does it mean?

Scheduled Pinned Locked Moved C / C++ / MFC
debuggingquestion
5 Posts 3 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.
  • U Offline
    U Offline
    uus99
    wrote on last edited by
    #1

    I have a program, that displays this in the debug window when i exit it. Do i have to worry? What does the exit code mean? I thought a healthy program should return an exit code of 0. The thread 0xF48 has exited with code 2 (0x2). The thread 0x3B8 has exited with code 2 (0x2). The thread 0xF70 has exited with code 2 (0x2). The thread 0xDCC has exited with code 2 (0x2). The program 'D:\Documents\BarcodeRT ver2.2\Debug\BarcodeRT.exe' has exited with code 2 (0x2).

    M A 2 Replies Last reply
    0
    • U uus99

      I have a program, that displays this in the debug window when i exit it. Do i have to worry? What does the exit code mean? I thought a healthy program should return an exit code of 0. The thread 0xF48 has exited with code 2 (0x2). The thread 0x3B8 has exited with code 2 (0x2). The thread 0xF70 has exited with code 2 (0x2). The thread 0xDCC has exited with code 2 (0x2). The program 'D:\Documents\BarcodeRT ver2.2\Debug\BarcodeRT.exe' has exited with code 2 (0x2).

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      An exit code of 2 has no intrinsic meaning, nor does 0. It's the convention that 0 means "app exited normally" but that's not a rule. The process and each thread has an exit code, and the code can be used for whatever purpose the app wants. --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- Pinky, are you pondering what I'm pondering? I think so Brain, but if we shaved our heads, we'd look like weasels!

      1 Reply Last reply
      0
      • U uus99

        I have a program, that displays this in the debug window when i exit it. Do i have to worry? What does the exit code mean? I thought a healthy program should return an exit code of 0. The thread 0xF48 has exited with code 2 (0x2). The thread 0x3B8 has exited with code 2 (0x2). The thread 0xF70 has exited with code 2 (0x2). The thread 0xDCC has exited with code 2 (0x2). The program 'D:\Documents\BarcodeRT ver2.2\Debug\BarcodeRT.exe' has exited with code 2 (0x2).

        A Offline
        A Offline
        Antony M Kancidrowski
        wrote on last edited by
        #3

        Since you have the code you ought to be able to see where the threads are setting the exit code to 2. Hopefully there will be an explaination of what the originall programmer meant by exiting with 2 rather than any other number. Ant. I'm hard, yet soft.
        I'm coloured, yet clear.
        I'm fuity and sweet.
        I'm jelly, what am I? Muse on it further, I shall return!
        - David Williams (Little Britain)

        U 1 Reply Last reply
        0
        • A Antony M Kancidrowski

          Since you have the code you ought to be able to see where the threads are setting the exit code to 2. Hopefully there will be an explaination of what the originall programmer meant by exiting with 2 rather than any other number. Ant. I'm hard, yet soft.
          I'm coloured, yet clear.
          I'm fuity and sweet.
          I'm jelly, what am I? Muse on it further, I shall return!
          - David Williams (Little Britain)

          U Offline
          U Offline
          uus99
          wrote on last edited by
          #4

          Well, i wrote the program, and it spawns an additional 1 thread. I didnt return any value when i exit the thread, and that's why i'm wondering why it returns a value of 2.

          A 1 Reply Last reply
          0
          • U uus99

            Well, i wrote the program, and it spawns an additional 1 thread. I didnt return any value when i exit the thread, and that's why i'm wondering why it returns a value of 2.

            A Offline
            A Offline
            Antony M Kancidrowski
            wrote on last edited by
            #5

            Um, Could you post a snippet of the code that generates the thread and the function that exits the thread code? That may help? Ant. I'm hard, yet soft.
            I'm coloured, yet clear.
            I'm fuity and sweet.
            I'm jelly, what am I? Muse on it further, I shall return!
            - David Williams (Little Britain)

            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