OLE DB Programmer's Reference | |
When a component using Automation causes an error, it can return an object to describe that error. To do this, the component must do the following:
- Call CreateErrorInfo in the Automation DLL. This function creates an Automation error object that exposes ICreateErrorInfo and IErrorInfo.
- Call the methods in ICreateErrorInfo to store information in the error object, such as the string describing the error and the GUID of the interface that caused the error.
- Call QueryInterface to retrieve the IErrorInfo interface pointer on the error object. This interface pointer identifies the error object to all Automation components.
- Call SetErrorInfo in the Automation DLL and pass it the IErrorInfo interface pointer. This function replaces its current error object, if any, with the new error object and adds a reference count to the new error object.
- Call Release to release the ICreateErrorInfo and IErrorInfo interface pointers. This effectively transfers ownership of the error object from the component that caused the error to the Automation DLL.
1998-2001 Microsoft Corporation. All rights reserved.