ErrorHandler::CallWithCOMConvention Method (Action^, Boolean)
Visual Studio 2015
Use this method when an interop interface might be implemented by managed code, and it is expected to return HRESULT error codes but also throws exceptions. This method catches all except the critical exceptions and returns the corresponding HRESULT for the caught exception.
Assembly: Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)
Parameters
- method
-
Type:
System::Action^
The method to call.
- reportError
-
Type:
System::Boolean
True to report the error
hr = ErrorHandler.CallWithCOMConvention(delegate() { object.method(param); }); } or hr = ErrorHandler.CallWithCOMConvention(() => object.method(param)); }
Show: