Kbase 21928: Application Error When Using QUIT on an OCX Trigger
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  4/2/2002 |
|
SUMMARY:
When using the QUIT command on an OCX trigger, you can get a fatal (GPF) error similar to the following:
prowin32.exe - Application Error
The instruction at "xxxxx" referenced memory "xxxx". The memory
could not be "read".
Click OK to terminate the application.
EXPLANATION:
This failure results from the fact that the OS or "C" run-time library procedure initiates the firing of an OCX event, and is therefore on the stack when the event procedure runs. When the QUIT statement is executed within the OCX trigger, Progress ends up calling the system function "exit" before unwinding back to the OS. This causes a GPF.
An example of this error can be seen when using the command QUIT in a PSTimer OCX.Tick trigger. However, this can happen with any ActiveX control.
SOLUTION:
To avoid this problem, empty the stack up to the OS which
initiated the OCX event. This can be done by issuing the command,
PROCESS EVENTS, just before the QUIT statement.
PROCESS EVENTS causes the session to return all the way back to the event dispatcher loop before finishing the trigger execution.
NOTE: Up until 9.1C, executing the QUIT statement in the Tick event procedure for the PSTimer caused a GPF or hang for a different reason. That issue was fixed beginning with patch 9.1C19.