
ISupportErrorInfo question.
This is probably a simple problem but I can`t seem to solve it.
I have an exe server with a singleton object objA. Clients connect to this
object via instances of another object objB.
objA uses interface IA.
objB uses interface IB (which derives from IA).
When the client app invokes a method on objA it transfers the call to its
equivalent method on objB.
Both objA and objB use ISupportErrorInfo.
A certain method call will result in a method on singleton objA catching a
_com_error in a try/catch block.
I use SetErrorInfo in the method that fails and return a failure code to the
method on objB that invoked it. In the check to see if the method on objA
failed I do a GetErrorInfo and a SetErrorInfo within objB then return a
failure code to the client app.
However I don`t seem to be getting the error information back to the client
correctly as in vb the err object just displays the default error ( ie
method'x' of objB failed)
I have noticed that when the client queries objB for
InterfaceSupportsErrorInfo it is passing in the IID of IA , not IB, so I
have added IID_IA to the array of interfaces that the array looks in for a
match.
Any ideas why I don`t get the correct information back? When I look at the
data I pass to SetErrorInfo in the method of objB, just before I return the
fail code to the client, the data seems ok.
Sorry if my explanation is a little difficult to understand.
Thanks in advance
Richard