Kbase P129143: 4GL/ABL: Error (5884) generated referencing an Automation Object method.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  09/03/2009 |
|
Status: Verified
SYMPTOM(s):
4GL/ABL: Error (5884) generated referencing an Automation Object method.
Invalid component-handle referenced while processing method/statement: <method or statement name>. <COM message> <program name> (5884)
Invalid component-handle referenced while processing method/statement: Tools. CreateMenuBar WinBars.p (5884)
The error is generated referencing the RemoveAll method of the Tools attribute of a Data Dynamics ActiveBar OCX control COM-HANDLE.
OpenEdge 10.1B02 and higher
The application runs error free under 10.1B and 10.1B01.
FACT(s) (Environment):
Windows
OpenEdge 10.1B
CAUSE:
Prior to OpenEdge 10.1B02, no COM event were allowed to fire before the first I/O blocking statement (e.g. WAIT-FOR). If code, that would normally fire a COM Object Event is executed, the COM Object Event Procedure was simply ignored.
Starting with OpenEdge 10.1B02, these COM Object Event Procedures are now allowed to fire before the first I/O blocking statement.
In this particular application's setup procedure, the application code sets the MenuBar object to VISIBLE causing the COM Object Event Procedure BandOpen to fire. This COM Object Event Procedure executes RELEASE OBJECT statements that invalidates the COM-HANDLE of the ActiveX object. The error is generated when later code references the RemoveAll method of the Tools attribute of the invalidated COM-HANDLE.
The same application ran error free prior to OpenEdge 10.02 because the COM Object Event Procedure that releases the ActiveX COM-HANDLE was not allowed to fire before the first I/O blocking statement (e.g. WAIT-FOR).
FIX:
Always RELEASE an Automation Object ONLY when you are certain no other functionality in your application requires it and always check the validity of a COM-HANDLE before calling its methods or setting its attributes.
Keep in mind that if more than one COM-HANDLE variable references the same automation object, releasing the object with one of these component handles invalidates them all.