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. COM
  4. Fatal Error Handling

Fatal Error Handling

Scheduled Pinned Locked Moved COM
c++comsysadminhelpquestion
4 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.
  • N Offline
    N Offline
    Nathan Holt at EMOM
    wrote on last edited by
    #1

    I have a COM collection object that maintains two STL containers. While it is unlikely, it is possible that an exception will be thrown while the containers are out of sync. In a normal application, I would simply abort under those conditions. What should an in process COM server do if such a fatal error occurs? Nathan

    L 1 Reply Last reply
    0
    • N Nathan Holt at EMOM

      I have a COM collection object that maintains two STL containers. While it is unlikely, it is possible that an exception will be thrown while the containers are out of sync. In a normal application, I would simply abort under those conditions. What should an in process COM server do if such a fatal error occurs? Nathan

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Nathan, Usually, Exceptions in COM server shouldn't bubble up. Since it's an inproc server, aborting would terminate your client application. I don't know any solution that I have implemented but does any of the following help you device a framework - 1. Supporting ISupportErrorInfo for rich error information and your methods could fail with some HRESULT. Client is expected to take necessary action. 2. Not a good one, but if these are internal error and assuming there is no method call in progress, you could implement an event handler and notify client of this exception. Just back from work so can't think of any more solutions :( Let me know if this helps.

      Sohail

      N 1 Reply Last reply
      0
      • L Lost User

        Nathan, Usually, Exceptions in COM server shouldn't bubble up. Since it's an inproc server, aborting would terminate your client application. I don't know any solution that I have implemented but does any of the following help you device a framework - 1. Supporting ISupportErrorInfo for rich error information and your methods could fail with some HRESULT. Client is expected to take necessary action. 2. Not a good one, but if these are internal error and assuming there is no method call in progress, you could implement an event handler and notify client of this exception. Just back from work so can't think of any more solutions :( Let me know if this helps.

        Sohail

        N Offline
        N Offline
        Nathan Holt at EMOM
        wrote on last edited by
        #3

        Thanks! That's about what I thought. From what I've read, E_UNEXPECTED is intended for that sort of thing. Nathan

        L 1 Reply Last reply
        0
        • N Nathan Holt at EMOM

          Thanks! That's about what I thought. From what I've read, E_UNEXPECTED is intended for that sort of thing. Nathan

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Yes. by HRESULT I meant E_UNEXPECTED in this case, but you may want to specialize this error code if required.

          Sohail

          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