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. C++ Exception Handling

C++ Exception Handling

Scheduled Pinned Locked Moved C / C++ / MFC
c++hardwarehelpquestion
5 Posts 4 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.
  • I Offline
    I Offline
    IceBerG71
    wrote on last edited by
    #1

    Hi In the past thread, i asked about C++ exception handling using __try, __except and _try __finally blocks to safeguard my codes against carelessness programming as well as unforeseen events... I am using on a embedded WinCE platform after almost completing my module, i find that the size of the programs grows a lot, from the initial 10k to abt 100k. Is there anyway to minimise the size and at the same time without compromise reliably. The size is critical as my program may need to upgrade through IR and if it is huge, time is a factor but i can't sacrifice for a reliable program any help pls?? thanx

    D J P 3 Replies Last reply
    0
    • I IceBerG71

      Hi In the past thread, i asked about C++ exception handling using __try, __except and _try __finally blocks to safeguard my codes against carelessness programming as well as unforeseen events... I am using on a embedded WinCE platform after almost completing my module, i find that the size of the programs grows a lot, from the initial 10k to abt 100k. Is there anyway to minimise the size and at the same time without compromise reliably. The size is critical as my program may need to upgrade through IR and if it is huge, time is a factor but i can't sacrifice for a reliable program any help pls?? thanx

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

      IceBerG71 wrote: ...the size of the programs grows a lot, from the initial 10k to abt 100k Are you relating the growth directly to the inclusion of exception handling?


      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

      I 1 Reply Last reply
      0
      • I IceBerG71

        Hi In the past thread, i asked about C++ exception handling using __try, __except and _try __finally blocks to safeguard my codes against carelessness programming as well as unforeseen events... I am using on a embedded WinCE platform after almost completing my module, i find that the size of the programs grows a lot, from the initial 10k to abt 100k. Is there anyway to minimise the size and at the same time without compromise reliably. The size is critical as my program may need to upgrade through IR and if it is huge, time is a factor but i can't sacrifice for a reliable program any help pls?? thanx

        J Offline
        J Offline
        Joe Woodbury
        wrote on last edited by
        #3

        If size is critical, don't use exceptions for careless programming, only to actually catch critical errors outside your control. You could also drop C++ exception handling entirely and use only Win32 structured exception handling. (My opinion may be unpopular, but C++ exception handling itself does not ensure a reliable program. It helps clean up the stack, but in the end, is just another error handling mechanism. I use exceptions very sparingly; mainly where other error handling techniques grow more cumbersome than if I had used exceptions.) Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

        1 Reply Last reply
        0
        • I IceBerG71

          Hi In the past thread, i asked about C++ exception handling using __try, __except and _try __finally blocks to safeguard my codes against carelessness programming as well as unforeseen events... I am using on a embedded WinCE platform after almost completing my module, i find that the size of the programs grows a lot, from the initial 10k to abt 100k. Is there anyway to minimise the size and at the same time without compromise reliably. The size is critical as my program may need to upgrade through IR and if it is huge, time is a factor but i can't sacrifice for a reliable program any help pls?? thanx

          P Offline
          P Offline
          Paul Ranson
          wrote on last edited by
          #4

          FWIW '__try/__except/__finally' aren't C++ exception handling, it's (AFAIK) an MS enhancement to their C and C++ compilers that allows code to be generated for Win32 Structured Exception Handling. In the Windows world C++ exceptions are built on top of this. This obviously doesn't help you, but getting the terminology right cannot hurt... Paul

          1 Reply Last reply
          0
          • D David Crow

            IceBerG71 wrote: ...the size of the programs grows a lot, from the initial 10k to abt 100k Are you relating the growth directly to the inclusion of exception handling?


            "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

            I Offline
            I Offline
            IceBerG71
            wrote on last edited by
            #5

            Yes, the size was a result of adding the excpetion blocks, maybe i use too extensive, every functions i use the exception to protect the codes in case there is any errors resulting in unforseen cases. initially, it helps me in debugging, after solving the bugs, so far, the exception was never resulted but frankly speaking, it is hard to predict what user can do to it since there is user entry portion. I checked MS website, it was indicated that the __try __ except is WIN32 exception handling. and they also indicated not all cases can be captured by the __try block.

            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