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. Error in COM

Error in COM

Scheduled Pinned Locked Moved COM
comhelpquestion
6 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello everyone, I am new at COM. I want to implement a COM object that throws _com_error objects as error. How can I implement such a functionality in my COM object. Busy Bee

    H C M R L 5 Replies Last reply
    0
    • L Lost User

      Hello everyone, I am new at COM. I want to implement a COM object that throws _com_error objects as error. How can I implement such a functionality in my COM object. Busy Bee

      H Offline
      H Offline
      Henrik Sternberg
      wrote on last edited by
      #2

      Hi Busy, Sorry, but the COM standard only allow COM-errors, if you want it to throw a generic error, you can write a wrapper for your COM-module, that catch a com error and then throw an error. /_henrik Henrik Sternberg, Cambridge Technolgy Partners Central Europe www.ctp.com/ce

      1 Reply Last reply
      0
      • L Lost User

        Hello everyone, I am new at COM. I want to implement a COM object that throws _com_error objects as error. How can I implement such a functionality in my COM object. Busy Bee

        C Offline
        C Offline
        Carlos Antollini
        wrote on last edited by
        #3

        Are you working with ATL? Cheers Carlos Antollini.

        1 Reply Last reply
        0
        • L Lost User

          Hello everyone, I am new at COM. I want to implement a COM object that throws _com_error objects as error. How can I implement such a functionality in my COM object. Busy Bee

          M Offline
          M Offline
          Michael P Butler
          wrote on last edited by
          #4

          Look at IErrorInfo in combination with HRESULT. There is plenty of info in MSDN. Michael :-)

          1 Reply Last reply
          0
          • L Lost User

            Hello everyone, I am new at COM. I want to implement a COM object that throws _com_error objects as error. How can I implement such a functionality in my COM object. Busy Bee

            R Offline
            R Offline
            Rashid Thadha
            wrote on last edited by
            #5

            if you are using ATL then you can use the method Error to throw the exception, this will be caught in a _com_error catch e.g. instead of returning S_OK; do the following return Error(_bstr_t(ErrorDescription).copy(), IID_IObj);

            1 Reply Last reply
            0
            • L Lost User

              Hello everyone, I am new at COM. I want to implement a COM object that throws _com_error objects as error. How can I implement such a functionality in my COM object. Busy Bee

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

              Thank you every one. I have figured all that out. The actual class should have an implementation of ISupportErrorInfo. Thanks everyone again.

              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