Consultor Eletrônico



Kbase P142346: Visual Designer fails to load form when Progress AVM crashes with "SYSTEM ERROR in a .NET event hand
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   04/03/2009
Status: Unverified

SYMPTOM(s):

Visual Designer fails to load form when Progress AVM crashes with "SYSTEM ERROR in a .NET event handler"

SYSTEM ERROR in a .NET event handler
Exception code: C0000005 ACCESS_VIOLATION
Fault address: 10281FD7 DLC\bin\prow32.dll

Error 12869 is generated after the SYSTEM ERROR occurs

Invalid cast from Progress.Windows.Form to Interface.IEventHandler. (12869)

Visual Designer canvas displays the error:

Visual Designer cannot load this class
com.progress.ipccom.IPCException: Connection closed by peer

Stack trace from PROWIN32 reads:

wwAlertBox
ioDisplayAlertBox
ioMsgDisplay
msgw

Monitoring Progress AVM via Visual Studio debugger shows the processes leading up to the failure:

Adding System.ComponentModel.Design.IEventBindingService service to DesignSurfaceManager
Adding System.Windows.Forms.Design.IUIService service to DesignSurfaceManager
Adding System.ComponentModel.Design.ITypeResolutionService service to DesignSurfaceManager
DesignsurfaceManager is instantiated.
First-chance exception at 0x7c812aeb in prowin32.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x0012a168..
First-chance exception at 0x7c812aeb in prowin32.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x7c812aeb in prowin32.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x0012adc8..
First-chance exception at 0x7c812aeb in prowin32.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x7c812aeb in prowin32.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x7c812aeb in prowin32.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x7c812aeb in prowin32.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x7c812aeb in prowin32.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
About to create DesignSurface by DesignSurfaceManager
Creating new design surface
Initializing KeyHandler Support.
Adding System.ComponentModel.Design.IResourceService service to design surface
Loading ABLCodeDOMDesignerLoader
Adding System.ComponentModel.Design.DesignerOptionService service to design surface
Adding various services to designsurface
Adding System.ComponentModel.Design.IMenuCommandService service to design surface
Adding System.ComponentModel.Design.ITypeDiscoveryService service to design surface
Adding System.ComponentModel.Design.IHelpService service to design surface
Converting IPC to CodeDOM
First-chance exception at 0x7c812aeb in prowin32.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x0012b5a4..
First-chance exception at 0x7c812aeb in prowin32.exe: 0xE0434F4D: 0xe0434f4d.
First-chance exception at 0x7c812aeb in prowin32.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x0012b5f8..
First-chance exception at 0x7c812aeb in prowin32.exe: 0xE0434F4D: 0xe0434f4d.
First-chance exception at 0x10281fd7 (prow32.dll) in prowin32.exe: 0xC0000005: Access violation reading location 0x00000024.
First-chance exception at 0x7c812aeb in prowin32.exe: Microsoft C++ exception: rnWinException at memory location 0x0012cc8c..

FACT(s) (Environment):

Form contains implements an Interface for event-handling
Form contains an ABL user-control
Interface is used to subscribe events in the ABL user-control to event-handler methods in the main form
Errors occur when calling the SUBSCRIBE method and attempting to CAST the parent of THIS-OBJECT to the interface:

IF VALID-OBJECT(THIS-OBJECT:Parent) THEN
ultraButton1:Click:Subscribe(CAST(THIS-OBJECT:Parent, InterfaceForEvents.IEventHandler):ClickEventHandler) .
OpenEdge 10.2A
Windows

CAUSE:

Bug# OE00181729

FIX:

Add TYPE-OF clause to check that object is of the correct type. For example, use this statement:

IF VALID-OBJECT(THIS-OBJECT:Parent) AND TYPE-OF (THIS-OBJECT:Parent, Interface.IEventHandler) THEN
ultraButton1:Click:Subscribe(CAST(THIS-OBJECT:Parent, Interface.IEventHandler):ClickEventHandler) .

Instead of this one:

IF VALID-OBJECT(THIS-OBJECT:Parent) THEN
ultraButton1:Click:Subscribe(CAST(THIS-OBJECT:Parent, InterfaceForEvents.IEventHandler):ClickEventHandler) .