NextPrevUpTopContentsIndex

1.7.2 Error handling

Most COM methods return an integer hresult to indicate success or failure, which can be checked using succeeded,. s_ok, hresult-equal or check-hresult.

In addition, after calling a COM method that provides extended error information, you can call the function get-error-info to obtain more details of any error that occurred. This is supplied with a list of fields , which should be keywords specifying the parts of the error information to obtain.

For example, in the session below, tt is a COM interface pointer for the i-test-suite-1 interface:

CL-USER 186 > (call-com-interface (tt i-test-suite-1 fx))
 
"in fx"           ;; implementation running
-2147352567       ;; the error code DISP_E_EXCEPTION
 
CL-USER 187 > (get-error-info :fields '(:description
                                        :source))
("foo" "fx")
 
CL-USER 188 > 

LispWorks COM/Automation User Guide and Reference Manual - 21 Feb 2008

NextPrevUpTopContentsIndex