4. Upgrading from OpenROAD 4.0 or 4.1 : Phase 2: Convert the Applications : Known 4.1 Issues to Resolve : Change in Handling of Synchronous ActiveX Events
 
Share this page                  
Change in Handling of Synchronous ActiveX Events
Note:  This issue affects only applications using ActiveX components. It does not affect those upgrading from OpenROAD 4.1 SP3. It also does not affect applications that have no ON EXTCLASSEVENT code blocks.
This issue manifests in a variety of ways, and unpredictably. It is therefore difficult to detect, but can be anticipated and avoided as detailed below.
ISSUE: A change introduced in OpenROAD 4.1 SP3 resulted in the current version of OpenROAD handling ActiveX events differently from OpenROAD 4.1 SP2 or previous releases.
Prior to OpenROAD 4.1 SP3, when a frame invoked an ActiveX component that generated events (Internet Explorer generates many progress-related events), those events went to the end of the OpenROAD queue. Although this was simple to handle, in many situations the information arrived too late to be useful.
From OpenROAD 4.1 SP3 and forward, these events were handled immediately when they were received, similar to .NET and Visual Basic. When such an event is received the next statement executed is the first code statement associated with that event. This means that where ActiveX events are involved, developers can no longer rely on the “single thread principle” that no event will start until the current event has completed.
The following scenarios can result in a change of behavior when upgrading to the current version of OpenROAD. Changes will be necessary if:
The code in an ActiveX event block depends on OpenROAD code having been executed since the ActiveX component was invoked
The code in an ActiveX event block itself invokes, directly or indirectly, an ActiveX component whose events trigger some other OpenROAD code
RESOLUTION: Identify all such cases in your applications. A simple code change corrects most cases by effectively restoring the behavior prior to the upgrade.
Split the ON EXTCLASSEVENT code block into two code blocks by inserting extra code into the code block, immediately after the BEGIN (or "{") statement, as illustrated in the following example.
Code BEFORE upgrade:
ON EXTCLASSEVENT 'StatusTextChange'
(
p_v_text = VARCHAR(256) NOT NULL;
)=
BEGIN
// … do stuff …
END;
Code AFTER upgrade:
ON EXTCLASSEVENT 'StatusTextChange'
(
p_v_text = VARCHAR(256) NOT NULL;
)=
BEGIN
CurFrame.SendUserEvent('XEvent StatusTextChange',p_v_text=p_v_text);
END;
 
ON USEREVENT 'XEvent StatusTextChange'
(
p_v_text = VARCHAR(256) NOT NULL;
)=
BEGIN
// … do stuff …
END;