المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Propagate Error Info: Use ATL and C++ to Implement Error-Handling COM Objects



C++ Programming
03-29-2009, 02:42 AM
Predefined error codes returned from HRESULT aren't always much help for debugging COM C++ code. The C++ macros provided with this article produce an XML file listing the error and its context to make debugging easier. This article begins with an overview of error handling in COM, then discusses the COM interfaces used in the macros. It explains how C++ exceptions are caught and converted to COM-compatible error information, how events are logged with the event viewer, and how context is reported in the description string of IErrorInfo. The macros handle logic errors and errors returned by an object or API.

Panos Kougiouris

<a href="http://msdn.microsoft.com/magazine/d8d3bac1-5e03-4494-87b5-3302066953d4">MSDN Magazine October 2000