ErrorInfo.hpp File Reference

COM error handling macros and functions. More...


Namespaces

namespace  COM

Defines

#define COM_CATCH(retval)
 Catch any exceptions, write the message to the debugger and set the return value.

Functions

bool COM::SetComErrorInfo (const char *pszSource, const char *pszDescription)
 Set the COM ErrorInfo object for the thread.


Detailed Description

COM error handling macros and functions.

Author:
Chris Oldwood

Define Documentation

#define COM_CATCH ( retval   ) 

Value:

catch (const WCL::ComException& e)                      \
                                    {                                                       \
                                        TRACE2(TXT("WCL::ComException exception caught in '%hs' - %hs\n"), __FUNCTION__, e.what()); \
                                                                                            \
                                        COM::SetComErrorInfo(__FUNCTION__, e.what());       \
                                                                                            \
                                        retval = e.m_hResult;                               \
                                    }                                                       \
                                    catch (const WCL::Win32Exception& e)                    \
                                    {                                                       \
                                        TRACE2(TXT("WCL::Win32Exception exception caught in '%hs' - %hs\n"), __FUNCTION__, e.what());   \
                                                                                            \
                                        COM::SetComErrorInfo(__FUNCTION__, e.what());       \
                                                                                            \
                                        retval = HRESULT_FROM_WIN32(e.m_dwError);           \
                                    }                                                       \
                                    catch (const std::exception& e)                         \
                                    {                                                       \
                                        TRACE2(TXT("std::exception caught in '%hs' - %hs\n"), __FUNCTION__, e.what());  \
                                                                                            \
                                        COM::SetComErrorInfo(__FUNCTION__, e.what());       \
                                                                                            \
                                        retval = E_UNEXPECTED;                              \
                                    }
Catch any exceptions, write the message to the debugger and set the return value.


Generated on Wed Feb 13 22:53:38 2008 for COM Library by  doxygen 1.5.2