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

set-error-info Function

Summary

Sets the error information for the current Automation method.

Package

com

Signature

set-error-info &key iid source description help-file help-context => error-code

Arguments
iid
nil, a symbol naming a COM interface or a refguid foreign pointer.
source
A string or nil.
description
A string or nil.
help-file
A string or nil.
help-context
An integer or nil.
Values
error-code
The error code DISP_E_EXCEPTION or nil if the error info could not be set.
Description

The function set-error-info allows the various components of the error information to be set for the current Automation method. It should only be called within the dynamic scope of the body of a define-com-method definition. The value DISP_E_EXCEPTION can be returned as the hresult of the method to indicate failure.

If iid is non-nil, it is set as IID of the interface that defined the error, or nil if none.

If source is non-nil, it is set as the ProgID for the class that raised the error.

If description is non-nil, it is set as the textual description of the error.

If help-file is non-nil, it is set as the path of the help file that describes the error.

If help-context is non-nil, it is set as the help context id for the error.

Examples
(define-com-method (i-robot rotate) 
    ((this i-robot-impl)
     (axis :in)
     (angle-delta :in))
  (let ((joint (find-joint axis)))
    (if joint
        (progn
          (rotate-joint joint)
          S_OK)
      (set-error-info :iid 'i-robot
                      :description "Bad joint."))))
See also

define-com-method
get-error-info
refguid
hresult


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