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:

To access the first error in the error queue from a COM program

  1. 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.

  2. Call the GetErrorQueue method of the IRepositoryErrorQueueHandler interface to obtain an IRepositoryErrorQueue interface pointer.

  3. 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

  1. 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.

  2. Call the GetErrorQueue method of the IRepositoryErrorQueueHandler interface to obtain an IRepositoryErrorQueue interface pointer.

  3. Call the _NewEnum method of the IRepositoryErrorQueue interface to obtain an IEnumRepositoryErrors interface pointer.

  4. Call the Next method of the IEnumRepositoryErrors interface to return error information for the first error in the queue.

  5. 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.