Skip to content

Problem with DoEvents #872

@ecosSystem

Description

@ecosSystem

In Terminal.PRG exists the function DoEvents():

FUNCTION DoEvents() AS VOID
UnSafeNativeMethods.DoEvents()

INTERNAL CLASS UnSafeNativeMethods
STATIC METHOD DoEvents() AS VOID
local msg as xMessage
local handle as HandleRef
msg := xMessage{}
handle := HandleRef{}
DO WHILE UnSafeNativeMethods.PeekMessage( REF msg,handle, 0,0, PM_NOREMOVE)
IF UnSafeNativeMethods.GetMessage( REF msg, handle,0,0 )
UnSafeNativeMethods.TranslateMessage(REF msg)
UnSafeNativeMethods.DispatchMessage(REF msg)
ENDIF
ENDDO
RETURN

In VO this function was defined like this:

FUNCTION DoEvents()
LOCAL msg IS _WINMSG
WHILE(PeekMessage(@msg,0, 0,0, PM_NOREMOVE))
IF GetMessage(@msg, 0,0,0 )
TranslateMessage(@msg)
DispatchMessage(@msg)
ENDIF
ENDDO

RETURN NIL

ReportPro (and our Application) uses Doevents() a lot which creates a crash:

Der folgende Fehler ist aufgetreten während der Bewegung auf den ersten logischen Satz.:
Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.

If I insert the VO-Function into ReportPro-source and our Application-source everything works as before.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions