Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : ActiveX Control Support : Managing ActiveX controls at runtime : Releasing control resources : Releasing COM objects individually
 
Releasing COM objects individually
If you try to release an ActiveX control (using the RELEASE OBJECT statement) before the control-frame is deleted, this works but is unnecessary. If you try to access a control after the control-frame is deleted, the ABL Virtual Machine (AVM) displays an error message that you are trying to reference an invalid component handle.
Because you have a component handle to a control-frame COM object, you might think you can release it using the RELEASE OBJECT statement. However for control-frame COM objects, ABL does not allow this because of the link between the control-frame widget and COM object.
Thus, you can only release the control-frame COM object by deleting the control-frame widget. If you do try to release the component handle of a control-frame, the AVM returns an error indicating that you should delete the object through the widget handle instead.
In general, if you do not delete or release any COM objects in an application, all active COM objects remain instantiated until the end of the OpenEdge session, at which time the AVM automatically releases them.
For more information on releasing COM object resources, see UsingCOM Objects in ABL.