Using the COM error handling interfaces and functions, you can return error information by following the steps below:
The error handling interfaces create and manage an error object, which provides information about the error. The error object is not the same as the object that encountered the error. It is a separate object associated with the current thread of execution.