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. .NET (Core and Framework)
  4. Interop exception

Interop exception

Scheduled Pinned Locked Moved .NET (Core and Framework)
comcsharpquestiondiscussion
4 Posts 3 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.
  • S Offline
    S Offline
    shezh
    wrote on last edited by
    #1

    Hi All, I'm accessing a COM object from my .NET application, but I keep on getting the following exception: "COM object that has been separated from its underlying RCW can not be used" Does anyone know how this exception can come about? I'd appreciate any thoughts, thanks. Shehzad

    M M S 3 Replies Last reply
    0
    • S shezh

      Hi All, I'm accessing a COM object from my .NET application, but I keep on getting the following exception: "COM object that has been separated from its underlying RCW can not be used" Does anyone know how this exception can come about? I'd appreciate any thoughts, thanks. Shehzad

      M Offline
      M Offline
      Member_3269611
      wrote on last edited by
      #2

      Hi, - Normally, 'Unmanaged COM' can be called in .NET through RCW(Runtime Callable Wrapper), So the COM which U have used is not supported by the .NET RCW. - May I now the COM Name, Is It Created By U / Not, In which application the COM Created. With Regards, Pandian S

      1 Reply Last reply
      0
      • S shezh

        Hi All, I'm accessing a COM object from my .NET application, but I keep on getting the following exception: "COM object that has been separated from its underlying RCW can not be used" Does anyone know how this exception can come about? I'd appreciate any thoughts, thanks. Shehzad

        M Offline
        M Offline
        Mike Dimmick
        wrote on last edited by
        #3

        The only links I can find are referring to ASP.NET, and basically I think it's that the original thread on which an STA object was created has exited, thereby effectively killing the object. When you try to use it the wrapper cannot marshal the object call and generates the exception.

        Stability. What an interesting concept. -- Chris Maunder

        1 Reply Last reply
        0
        • S shezh

          Hi All, I'm accessing a COM object from my .NET application, but I keep on getting the following exception: "COM object that has been separated from its underlying RCW can not be used" Does anyone know how this exception can come about? I'd appreciate any thoughts, thanks. Shehzad

          S Offline
          S Offline
          shezh
          wrote on last edited by
          #4

          Thanks for your help guys, Sorry S Pandian, I should've been clearer - I am actually able to use the COM object fine, only when I tried accessing it in another thread did I have this problem. Mike, I think you hit the nail on the head! I was creating the object in another thread, and then trying to access it later on, once that thread had exited. But without using another thread, everything works fine. Cheers guys, Shehzad

          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