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. COM and Exceptions

COM and Exceptions

Scheduled Pinned Locked Moved C / C++ / MFC
c++comxmlhelptutorial
3 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.
  • P Offline
    P Offline
    Perry Bruins
    wrote on last edited by
    #1

    Hi All, I am currently working on a XML interface to my application. I have implemented this as a COM interface, usable from within any language such as VBS, C/C++, etc. The problem is that some customers ask me to throw exceptions from within that COM interface, to be catched at the upper level from where the COM was instantiated. Does anyone know if this is possible at all, and if so, give me some pointers / hints in how to implement such a thing? Thanks a lot in advance! Perry Bruins (Netherlands)

    C 1 Reply Last reply
    0
    • P Perry Bruins

      Hi All, I am currently working on a XML interface to my application. I have implemented this as a COM interface, usable from within any language such as VBS, C/C++, etc. The problem is that some customers ask me to throw exceptions from within that COM interface, to be catched at the upper level from where the COM was instantiated. Does anyone know if this is possible at all, and if so, give me some pointers / hints in how to implement such a thing? Thanks a lot in advance! Perry Bruins (Netherlands)

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      All exceptions MUST be handled within the component, the only thing you can do is to pass back a HRESULT to indicate what happened. Of course, if you're passing back XML, you can pass back any other info you like, but you'll need to check the HRESULT for success, you simply cannot be throwing excpetions across processes or machines. Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002 Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002

      P 1 Reply Last reply
      0
      • C Christian Graus

        All exceptions MUST be handled within the component, the only thing you can do is to pass back a HRESULT to indicate what happened. Of course, if you're passing back XML, you can pass back any other info you like, but you'll need to check the HRESULT for success, you simply cannot be throwing excpetions across processes or machines. Christian I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002 Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002

        P Offline
        P Offline
        Perry Bruins
        wrote on last edited by
        #3

        Thanks a lot for your answer. I already thought it was not possible, but now I know for sure. Perry

        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