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