
Throwing com exceptions across process boundaries...
That's not the way it works. The server returns an error HRESULT and,
optionally, sets up rich error info - see CComCoClass::Error,
AtlReportError, ISupportErrorInfo. The client receives the error HRESULT
and retrieves rich error info. If the client happens to use
#import-generated smart wrappers, they internally check for error
HRESULT, construct a _com_error object and throw it as a C++ exception,
so that you can handle the errors with try/catch
Again - COM excpetions are purely an artifact of using #import-generated
smart wrappers client-side. They are not part of COM specification. You
should never let any C++ exceptions escape from your server. Any errors
are reported via an HRESULT and rich error info.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Quote:
> I have a COM exe and want to know if I throw com exceptions from this
> component, can I use try/catch - in my client - to catch the
exceptions.
> Note that it is possible that the COM exe will run on a remote
machine. I
> already have a connection point implemented and was wondering is this
> another option for signaling the client that errors occur.