Custom exceptions

Hi,

My Delphi implementation of CrossPlatform interface raises custom exceptions. Is there any way to have a corresponding custom exception being thrown on the C# side instead of the generic COMException? That way I could catch MyCustomException instead of COMException.

Regards
/Markus

Unfortunately it is not possible, one thing that you can do is to override how the error message passed to the .net side.

Delphi TObject have following method:
function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HResult; virtual;

this method is called when you raise an exception, so you can override it to provide custom details.

You can take a look at our implementation for THYFakeIDispatch class, in the uHYInterfaceHelpers.pas.