The predefined error code returned from HRESULT does not always help the COM C code debugging. The C macro in this article generates an XML file that lists errors and its context, making debugging easier. This article first provides an overview of the error handling in COM, and next discussion COM interface used in these macros. This article describes how to capture C exceptions, how to convert C exceptions into COM-compatible error messages, how to record events with event viewer, and how to use iERRORINFO's description string to report the context. These macros can handle logical errors and errors returned by objects or APIs.
Click here to read the full story