#include <comutil.h>
Public Member Functions | |
COMExceptionBase (HRESULT hr) | |
HRESULT | Error () const |
LPCTSTR | ErrorMessage () const |
Protected Attributes | |
HRESULT | _hr |
String | _msg |
Definition at line 58 of file comutil.h.
COMExceptionBase::COMExceptionBase | ( | HRESULT | hr | ) | [inline] |
HRESULT COMExceptionBase::Error | ( | ) | const [inline] |
LPCTSTR COMExceptionBase::ErrorMessage | ( | ) | const [inline] |
Definition at line 70 of file comutil.h.
References _hr, _msg, and _stprintf.
00071 { 00072 if (_msg.empty()) { 00073 LPTSTR pBuf; 00074 00075 if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, 00076 0, _hr, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPTSTR)&pBuf, 0, NULL)) { 00077 _msg = pBuf; 00078 LocalFree(pBuf); 00079 } else { 00080 TCHAR buffer[128]; 00081 _stprintf(buffer, TEXT("unknown Exception: 0x%08lX"), _hr); 00082 _msg = buffer; 00083 } 00084 } 00085 00086 return _msg; 00087 }
HRESULT COMExceptionBase::_hr [protected] |
String COMExceptionBase::_msg [mutable, protected] |
IBrowser Source Code Documentation
generated on 18.09.2008 by |