I'm writing an interface with COM code and I know that the only user of this interface is my own code (indirectly). If I throw an exception, can I catch it on the other side of the library that's in the middle? This is a termination condition so the world's most graceful cleanup isn't the biggest deal ever.
Exceptions aren't allowed to flow across a COM interface boundary. Because there is no binary contract for C++ exceptions, COM cannot marshal them from one thread to another. This might not be a huge issue now but it may be a problem later on if you decide to change the threading model of your COM object.
Also, what happens if you decide that you want to rewrite the front end of your application in C# (or Delphi or whatever)? COM HRESULTS are understood by the various COM interop frameworks but C++ exceptions aren't (no binary contract for C++ exceptions).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With