ImgControl_ProcessMessages

Process ImgControl messages.
ImgControl_ProcessMessages(controlName) ➔ msgCount
controlName Text The name of the ImgControl form object.
msgCount Longint The number of processed messages

Process messages for the ImgControl named controlName.

The ImgControl object uses an internal messaging system for its various internal parts to communicate with the host form. The processing of these messages is vital for the correct operation of the control and this method does the necessary work.

This method must be called from two places:

  • From the object method of the controlName ImgControl during the kImgControlMessage event.
  • From the host form method during the On Timer event.

The kImgControlMessage event in the object method is the result of internal messaging by means of the CALL SUBFORM CONTAINER 4D method. That should be enough for the control’s messaging, but we have found out that under some circumstances messages may take a long time to arrive from the subform context to the object method. That’s why the call from the host form’s On Idle event is necessary.

When calling this method from the host’s On Timer` event the method’s result should be checked, and if 0 the timer event be cancelled with SET TIMER(0). The internal messaging system will re-enable the timer when a new message has to be delivered.