NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

HRESULTs and Exceptions

COM methods report errors by returning HRESULTs, while NGWS methods report them by throwing exceptions. The NGWS runtime handles the transition between the two. Each exception class in NGWS maps to an HRESULT. User-defined exception classes can specify whatever HRESULT is appropriate, and they can dynamically change the HRESULT to be returned when the exception is thrown by setting the ErrorCode property on the exception object. Additional information about the exception is provided to the client through the IErrorInfo interface, which is implemented on the NGWS object in the unmanaged process space.