_com_error Class

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Microsoft Specific

A _com_error object represents an exception condition detected by the error-handling wrapper functions in the header files generated from the type library or by one of the COM support classes. The _com_error class encapsulates the HRESULT error code and any associated IErrorInfo Interface object.

Construction

_com_errorConstructs a _com_error object.

Operators

operator =Assigns an existing _com_error object to another.

Extractor Functions

ErrorRetrieves the HRESULT passed to the constructor.
ErrorInfoRetrieves the IErrorInfo object passed to the constructor.
WCodeRetrieves the 16-bit error code mapped into the encapsulated HRESULT.

IErrorInfo Functions

DescriptionCalls IErrorInfo::GetDescription function.
HelpContextCalls IErrorInfo::GetHelpContext function.
HelpFileCalls IErrorInfo::GetHelpFile function
SourceCalls IErrorInfo::GetSource function.
GUIDCalls IErrorInfo::GetGUID function.

Format Message Extractor

ErrorMessageRetrieves the string message for HRESULT stored in the _com_error object.

ExepInfo.wCode to HRESULT Mappers

HRESULTToWCodeMaps 32-bit HRESULT to 16-bit wCode.
WCodeToHRESULTMaps 16-bit wCode to 32-bit HRESULT.

Header: comdef.h

Lib: comsuppw.lib or comsuppwd.lib (see /Zc:wchar_t (wchar_t Is Native Type) for more information)

Compiler COM Support Classes
IErrorInfo Interface

Show: