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

com-error Condition Class

Summary

The condition class used to signal errors from COM.

Package

com

Superclasses

cl:error

Subclasses

com-dispatch-invoke-exception-error

Initargs
:hresult
An integer giving the hresult of the error.
:function-name
Either nil or a string or symbol describing the function that generated the error.
Readers

com-error-hresult
com-error-function-name

Description

The condition class com-error is used by the Lisp COM API when signaling errors that originate as hresult code from COM.

Examples

This function silently ignores the E_NOINTERFACE error:

(defun call-ignoring-nointerface-error (function)
  (handler-bind
      ((com-error
        #'(lambda (condition)
            (when (hresult-equal (com-error-hresult
                                  condition)
                                 E_NOINTERFACE)
              (return-from
                  call-ignoring-nointerface-error
                nil)))))
    (funcall function)))
See also

check-hresult
hresult-equal
hresult


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