.net assembly interop exceptions handling
I am calling a .Net assembly from a Delphi project using COM interop.
Can I catch .Net exceptions in Delphi thrown by the assembl开发者_运维知识库y?
COM does not work with .NET exceptions but with HRESULT
values. So there is no way you can catch .NET exceptions at Delphi side. You just receive a HRESULT with an error value. If you are lucky you will get an HRESULT with a specific error value so you know what has gone wrong, if you're unlucky, you will get some generic HRESULT value.
精彩评论