Most of the low-level COM and OLE functions return a status code as their first result value. You can test this value with the functions FAILED? and SUCCEEDED? to determine whether an error is indicated. You can also compare the value against various named constants to check for specific error conditions.
These constants are defined in source files under the top-level System folder in the Functional Developer distribution:
System\ole\com\com-err.dylan System\ole\ole-automation\auto-err.dylan
The Dylan type of OLE status codes is called either <SCODE> ("status code") or <HRESULT> ("result handle"). These two names mean the same thing; the reason for there being two names is historical.
Note: Do not assume that status code is an <integer>.
In order to simplify your application, the high-level OLE Automation functions do not require you to check status codes. Instead, when an error occurs, it is signalled automatically as an instance of class <ole-error>, a subclass of <error>.
If you call a low-level function and want to turn the status code into an error, do something like this:
let status = foo(interface, whatever); check-ole-status(status, "foo", interface, whatever);
The call to check-ole-status signals an <ole-error> if the call to foo fails.