Progress
Language Reference


RELEASE OBJECT Statement

Interfaces
OS
SpeedScript
All
All
Yes

Releases the specified COM object (Automation object or ActiveX control) and removes all internal structures associated with the handle to the object.

SYNTAX

RELEASE OBJECT COM-hdl-var [ NO-ERROR ] 

COM-hdl-var

A COM-HANDLE variable that references a valid COM object.

NO-ERROR

Specifies that any errors that occur in the attempt to release the object are suppressed. After the RELEASE OBJECT statement completes, you can check the ERROR-STATUS system handle for information on any errors that occurred.

EXAMPLE

This procedure fragment shows a control named hc_CmdButton being loaded into a control-frame and the handle to the control (controlHdl) being obtained using the control name (hc_CmdButton) property. Later, it releases the control and deletes the parent control-frame widget (CFWidHdl).

DEFINE VARIABLE CFWidHdl AS WIDGET-HANDLE. 
DEFINE VARIABLE CFComHdl AS COM-HANDLE.
DEFINE VARIABLE controlHdl AS COM-HANDLE.

/* Create frame foo ... */

CREATE CONTROL-FRAME CFWidHdl
  ASSIGN 
    FRAME = FRAME foo:HANDLE
    NAME = "ctlFrame1".
CFComHdl = CFWidHdl:COM-HANDLE.
CFComHdl:LoadControls(hc_CmdButton.wrx, "hc_CmdButton").

controlHdl = CFComHdl:hc_CmdButton.
controlHdl:BgColor = RGB-VALUE(0,128,0).

/* do some more stuff ... WAIT-FOR ... */
RELEASE OBJECT controlHdl. /* NOTE: Not really necessary */
DELETE WIDGET CFWidHdl. 

For an example of the RELEASE OBJECT statement applied to Automation objects, see the CREATE Automation Object Statement entry.

NOTES

SEE ALSO

CREATE Automation Object Statement, DELETE WIDGET Statement, DELETE WIDGET-POOL Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095