Accessing Error Information at the COM Level
COM programs can access all of the errors in a Microsoft® Repository error queue. You can use the IRepositoryErrorQueue COM interface to manage errors in a Repository error queue. With this interface, you can:
- Get a count of the number of errors in a queue.
- Enumerate the errors in a queue.
- Insert errors into a queue.
- Remove errors from a queue.
- Retrieve an error from a queue.
To access the first error in the error queue from a COM program
- Use the QueryInterface method of the IRepository interface to obtain an IRepositoryErrorQueueHandler interface pointer. There is an IRepository interface pointer associated with each instance of the Repository class.
- Call the GetErrorQueue method of the IRepositoryErrorQueueHandler interface to obtain an IRepositoryErrorQueue interface pointer.
- Use the Item method of the IRepositoryErrorQueue interface to retrieve the error information for the first error in the queue.
To access multiple errors in the error queue from a COM program
- Use the QueryInterface method of the IRepository interface to obtain an IRepositoryErrorQueueHandler interface pointer. There is an IRepository interface associated with each instance of the Repository class.
- Call the GetErrorQueue method of the IRepositoryErrorQueueHandler interface to obtain an IRepositoryErrorQueue interface pointer.
- Call the _NewEnum method of the IRepositoryErrorQueue interface to obtain an IEnumRepositoryErrors interface pointer.
- Call the Next method of the IEnumRepositoryErrors interface to return error information for the first error in the queue.
- Call the Next method of the IEnumRepositoryErrors interface to return error information for each of the remaining errors in the queue.
(c) 1988-1998 Microsoft Corporation. All Rights Reserved.