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. exception handling

exception handling

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 Posts 5 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.
  • D Offline
    D Offline
    Daniel Kanev
    wrote on last edited by
    #1

    I do not know a way to get all exceptions. try { } catch(CException *e){} is not working for all exceptions. If I put catch(...) it is ok but I cannot get the error message this way. Do you know what I can put in the catch () so that I can handle all exceptions having their messages. Thank you!

    W H 2 Replies Last reply
    0
    • D Daniel Kanev

      I do not know a way to get all exceptions. try { } catch(CException *e){} is not working for all exceptions. If I put catch(...) it is ok but I cannot get the error message this way. Do you know what I can put in the catch () so that I can handle all exceptions having their messages. Thank you!

      W Offline
      W Offline
      Waldermort
      wrote on last edited by
      #2

      In order to catch everything, you need to look at the docs for the function which is throwing the exception and then add a catch statement specific for that. try { } catch(CException *e) { } catch(LPTSTR szErr) { } catch(...) { }

      Waldermort

      S 1 Reply Last reply
      0
      • W Waldermort

        In order to catch everything, you need to look at the docs for the function which is throwing the exception and then add a catch statement specific for that. try { } catch(CException *e) { } catch(LPTSTR szErr) { } catch(...) { }

        Waldermort

        S Offline
        S Offline
        Sachinpatole
        wrote on last edited by
        #3

        Have u tried using "try-finally-statements" -Sachin

        D 1 Reply Last reply
        0
        • D Daniel Kanev

          I do not know a way to get all exceptions. try { } catch(CException *e){} is not working for all exceptions. If I put catch(...) it is ok but I cannot get the error message this way. Do you know what I can put in the catch () so that I can handle all exceptions having their messages. Thank you!

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          Im not sure but I think some times ago I saw a code on the http://www.koders.com about get exceptions see this site.

          1 Reply Last reply
          0
          • S Sachinpatole

            Have u tried using "try-finally-statements" -Sachin

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Exactly how does that get the text of the exception being thrown?


            "A good athlete is the result of a good and worthy opponent." - David Crow

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            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