14#error Native Compiler support only available in C++ compiler
22#define WINAPI __stdcall
42 _com_error(
const _com_error &that) throw();
43 virtual ~_com_error() throw();
50 _bstr_t HelpFile()
const;
58 void Ctor(
const _com_error &that) throw();
64 mutable TCHAR *m_pszMsg;
67inline _com_error::_com_error(
HRESULT hr,
IErrorInfo *perrinfo,
bool fAddRef)
throw() : m_hresult(
hr),m_perrinfo(perrinfo),m_pszMsg(
NULL) {
68 if(m_perrinfo!=
NULL && fAddRef) m_perrinfo->
AddRef();
71inline _com_error::_com_error(
const _com_error &that)
throw() {
75inline _com_error::~_com_error() throw() {
79inline _com_error &_com_error::operator=(
const _com_error &that)
throw() {
87inline HRESULT _com_error::Error()
const throw() {
return m_hresult; }
88inline WORD _com_error::WCode()
const throw() {
return HRESULTToWCode(m_hresult); }
90inline IErrorInfo *_com_error::ErrorInfo()
const throw() {
95inline _bstr_t _com_error::Description()
const {
97 if(m_perrinfo!=
NULL) m_perrinfo->GetDescription(&bstr);
98 return _bstr_t(bstr,
false);
101inline DWORD _com_error::HelpContext()
const throw() {
102 DWORD dwHelpContext = 0;
103 if(m_perrinfo!=
NULL) m_perrinfo->GetHelpContext(&dwHelpContext);
104 return dwHelpContext;
107inline _bstr_t _com_error::HelpFile()
const {
109 if(m_perrinfo!=
NULL) m_perrinfo->GetHelpFile(&bstr);
110 return _bstr_t(bstr,
false);
113inline _bstr_t _com_error::Source()
const {
115 if(m_perrinfo!=
NULL) m_perrinfo->GetSource(&bstr);
116 return _bstr_t(bstr,
false);
119inline _GUID _com_error::GUID_()
const throw() {
122 if(m_perrinfo!=
NULL) m_perrinfo->GetGUID(&
guid);
126inline const TCHAR *_com_error::ErrorMessage()
const throw() {
131 if(nLen > 1 && m_pszMsg[nLen - 1]==
'\n') {
132 m_pszMsg[nLen-1] = 0;
133 if(m_pszMsg[nLen - 2]==
'\r') m_pszMsg[nLen-2] = 0;
138 WORD wCode = WCode();
150inline HRESULT _com_error::WCodeToHRESULT(
WORD wCode)
throw() {
return wCode >= 0xFE00 ? WCODE_HRESULT_LAST : WCODE_HRESULT_FIRST + wCode; }
151inline WORD _com_error::HRESULTToWCode(
HRESULT hr)
throw() {
return (
hr >= WCODE_HRESULT_FIRST &&
hr <= WCODE_HRESULT_LAST) ?
WORD(
hr - WCODE_HRESULT_FIRST) : 0; }
153inline void _com_error::Dtor() throw() {
154 if(m_perrinfo!=
NULL) m_perrinfo->Release();
158inline void _com_error::Ctor(
const _com_error &that)
throw() {
159 m_hresult = that.m_hresult;
160 m_perrinfo = that.m_perrinfo;
162 if(m_perrinfo!=
NULL) m_perrinfo->AddRef();
165typedef int __missing_type__;
167#if !defined(_COM_SMARTPTR)
168#if !defined(_INC_COMIP)
171#define _COM_SMARTPTR _com_ptr_t
172#define _COM_SMARTPTR_LEVEL2 _com_IIID
174#if defined(_COM_SMARTPTR)
175#if !defined(_COM_SMARTPTR_TYPEDEF)
176#if defined(_COM_SMARTPTR_LEVEL2)
177#define _COM_SMARTPTR_TYPEDEF(Interface,IID) UUID IIDArgForTypedef ## Interface = IID; typedef _COM_SMARTPTR< _COM_SMARTPTR_LEVEL2<Interface, &IIDArgForTypedef ## Interface > > Interface ## Ptr
179#define _COM_SMARTPTR_TYPEDEF(Interface,IID) UUID IIDArgForTypedef ## Interface = IID; typedef _COM_SMARTPTR<Interface,&IIDArgForTypedef ## Interface > Interface ## Ptr
184#if !defined(_COM_NO_STANDARD_GUIDS_)
185#if defined(__IFontDisp_INTERFACE_DEFINED__)
192#if defined(__IFontEventsDisp_INTERFACE_DEFINED__)
193#if !defined(FontEvents)
198#if defined(__IPictureDisp_INTERFACE_DEFINED__)
static VOID ErrorMessage(_In_ DWORD dwErrorCode, _In_opt_ PCWSTR pszMsg,...)
static VOID HelpContext(PCONTEXT_ENTRY pContext)
void WINAPI _com_issue_errorex(HRESULT hr, IUnknown *punk, REFIID riid)
void WINAPI _com_issue_error(HRESULT hr)
void WINAPI _set_com_error_handler(COM_ERROR_HANDLER *phandler)
void WINAPI _com_raise_error(HRESULT hr, IErrorInfo *perrinfo)
#define _COM_PRINTF_S_1(dest, destsize, format, arg1)
static const WCHAR Description[]
#define MAKE_HRESULT(sev, fac, code)
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
static VARIANTARG static DISPID
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
#define FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_ALLOCATE_BUFFER