All Manuals > COM/Automation User Guide and Reference Manual > 2 COM Reference Entries

check-hresult Macro

Summary

Signals an error if a result code indicates a failure.

Package

com

Signature

check-hresult hresult function-name

Arguments
hresult
An integer hresult.
function-name
A name for inclusion in the error message.
Description

The macro check-hresult checks hresult and returns if it is one of the 'succeeded' values, for instance S_OK or S_FALSE. Otherwise check-hresult signals an error of type com-error, which will include function-name in its message.

Examples
(check-hresult S_OK "test") => nil
(check-hresult E_NOINTERFACE "test")
signals an error mentioning "test"
See also

succeeded
hresult
hresult-equal


COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38