Validating component handles
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Validating component handles
If you reference a COM-HANDLE variable whose
value does not point to a valid COM object, ABL returns an error
indicating that an action was performed on an invalid COM-HANDLE.
To protect against this error, use the ABL VALID-HANDLE function
to determine if the COM-HANDLE variable contains
a valid value before using it in any other ABL statement. As with
widget handles, the VALID-HANDLE function returns TRUE if
the component handle is valid.
Note that you cannot use the VALID-HANDLE function
to verify that a component handle value points to a particular COM
object. COM-HANDLE values might be reused within
an application when the COM objects they point to are no longer
available. For more information, see Managing COM object resources.
Also, this function only indicates that a component handle is invalid from some action (or inaction) of the OpenEdge application. It does not show as invalid a COM handle that a user might have manually closed, for example, an Automation Server application that provided the COM object.