Hi Mike,
In case someone knows off the top....
I am accessing a COM-interface-exposing C# dll in VC++ 6. The C# disp
method can throw a COMException.
Do I catch a _com_error ? It's not obvious from the docs.
That depends on how your VC++ 6 code looks like.
COM itself when it comes down to calling methods on interfaces uses
HRESULTs (32 bit numbers) to return error information. There are
"extensions" like IErrorInfo or EXCEPINFO which you can lookup
if you want.
The language you use COM in might add/integrate its error handling
concepts.
In VC++ you can use #import "typelib/progid/clsid" to auto generate
tli/tlh pairs where HRESULT can be translated to C++ exceptions
based on _com_error. You should catch(_com_error& ex) in this case.
Please recognize the & to avoid the creation of temporary copies of
the thrown object instance.
If you use the MFC class wizard to create COM client wrapper classes,
it uses another concept of giving you error information. I didn't use it
for ages, so I do not know anymore if they gave you the HRESULT or
did also encapsulate the error in some MFC COM error class.