Transfer Error Message: Using ATL and C ++ Implement Error Handling COM object

zhaozj2021-02-16  114

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

转载请注明原文地址:https://www.9cbs.com/read-10159.html

New Post(0)