Kbase 18250: ACTIVEX - How To Avoid Getting GPF's by releasing them?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  15/10/2008 |
|
Status: Verified
GOAL:
How to Avoid Getting GPF's with ActiveX's?
GOAL:
How to avoid General Protection Fault. (GPF).
FIX:
When using ActiveX it is possible to get GPF's because of not properly releasing all references to an object.
In order to eliminate the chance of having a "hanging reference" to an OCX (or one of its sub-objects) make certain that you follow these rules:
1) For any OCX "trigger" (really an internal procedure), make certain that you do a RELEASE OBJECT command on any input parameter that is defined as a COM-HANDLE (i.e. DEFINE INPUT PARAMETER X AS COM-HANDLE).
2) Anywhere in your code where you assign a value to a variable that is defined as a COM-HANDLE make certain that you do a RELEASE OBJECT command on the variable before assigning a new value to it if it already contains a valid reference to some object.