NextPrevUpTopContentsIndex

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 check-hresult macro checks the hresult and returns if the it is one of the 'succeeded' values, for instance S_OK or S_FALSE . Otherwise it signals an error of type com-error , which will include the 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


LispWorks COM/Automation User Guide and Reference Manual - 17 Jul 2006

NextPrevUpTopContentsIndex