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. ATL COM Server throws Exception.

ATL COM Server throws Exception.

Scheduled Pinned Locked Moved COM
c++helpcsharpcomsysadmin
2 Posts 1 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.
  • D Offline
    D Offline
    Diana Fernandez
    wrote on last edited by
    #1

    Hi I have searched a lot for this, but in vain. I found sites were the same problem has been raised, but nowhere with a proper answer. I hope I will get an answer here. I am using an ATL COM server in VC++ from C#. Object of a class from the COM side is successfully created at C# side. But while calling a method on that object it is throwing an error with message "The Server threw an exception". The Error encountered is 0X80010105. And the HRESULT is -2147417851. Everything was working fine until I made some changes at the client side. I don't think those changes have some relation in with this error. Code for the Server and client side are as shown below //Client side in C# ServerObj sObj = new ServerObj(); //Error is thrown here, arguments passed are interger, reference of structure and object of calling class. sObj.CallServerMethod(integer, ref structure, this); //Server side in VC++ STDMETHODIMP CServerObj ::CallServerMethod(int integer, tagStruct *pVal, VARIANT vt) { } Thanks in Advance, Diana.

    D 1 Reply Last reply
    0
    • D Diana Fernandez

      Hi I have searched a lot for this, but in vain. I found sites were the same problem has been raised, but nowhere with a proper answer. I hope I will get an answer here. I am using an ATL COM server in VC++ from C#. Object of a class from the COM side is successfully created at C# side. But while calling a method on that object it is throwing an error with message "The Server threw an exception". The Error encountered is 0X80010105. And the HRESULT is -2147417851. Everything was working fine until I made some changes at the client side. I don't think those changes have some relation in with this error. Code for the Server and client side are as shown below //Client side in C# ServerObj sObj = new ServerObj(); //Error is thrown here, arguments passed are interger, reference of structure and object of calling class. sObj.CallServerMethod(integer, ref structure, this); //Server side in VC++ STDMETHODIMP CServerObj ::CallServerMethod(int integer, tagStruct *pVal, VARIANT vt) { } Thanks in Advance, Diana.

      D Offline
      D Offline
      Diana Fernandez
      wrote on last edited by
      #2

      Hi I would like to add a new observation with the above mail. The problem is seen only in the Debug Mode. The first line in the that method ("assert(false);"), which enables debugging was commented out and its not throwing any more Exception and working fine. //Server side in VC++ STDMETHODIMP CServerObj ::CallServerMethod(int integer, tagStruct *pVal, VARIANT vt) { //assert(false); } But I don't know why it was happening. Regards, Diana.

      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