Hello,
By default COM wrapped as
void
on output, but it throws an exception if your method returns failed HRESULT.
You can handle
COMException[
^] in catch block. The
COMException.HResult
is the error code.
Another way is to create your own wrapper and specify
PreserveSig[
^] Attribute for the method and makes returns
int
instead of
void
.
More information about specified HRESULTS and .NET exceptions:
How to: Map HRESULTs and Exceptions[
^]
Regards,
Maxim.