Highlighted
Absent Member.
Absent Member.
653 views

[archive] Is it possible as to send a terminate-event when using an active-x control.

[Migrated content. Thread originally posted on 04 November 2005]

Is it possible as to send a terminate-event when using an active-x control.

Some explanation.
When using a grid I can use the terminate-event. The program now become of the screen accept. This make it possible to do statements after the accept, instead of in the event-procedure. When modifying an control in the event-procedure (which creating new events) the behavior of other accepts (or the controls itself) sometimes looks unpredictable.
So I terminate the event and do the programming after the accept of the control.

When using an active-x control it fires many events for such a thing as (as example) a click.
So it can happen that I take action on an event, which even after it becomes other events from the first action. Also the actions I take can even fire new events. One of the problems is, that when is do an accept with exception-key in a new screen (by program call) this accept should return the value of the exception-key.
But sometimes I get in this called program an event (mgs-ax-event ?) and it does not return the exception-key value. So I lost the exception-key value (but not always).

So it looks less complex to terminate the event and do some programming out of the event procedure.

Is this possible or are there other tips.
0 Likes
5 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Is it possible as to send a terminate-event when using an active-x control.

Any chance you can illustrate your problem with a small program?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Is it possible as to send a terminate-event when using an active-x control.

Ed1,

We have encountered the same problem, I think. If I understand you correctly, you are accepting an active-x control and some event takes you to another program. You are having a problem in that other program because you get events from the active-x control in the called program. Is this right?

If so, we've had this problem and we've solved it in one of two ways. One way is to do as you are suggesting and terminate the accept and respond to the event outside of the accept (because when you're not in an accept, the events won't fire). Another way we've handled this is to set a local flag that "disables" events. We accomplish this by getting out of the event procedure when this flag is set. I like the first option (the one you mentioned) the best.

We've been able to terminate the accept of active-x controls just like other controls. For exmaple, we just use "SET EVENT-ACTION TO EVENT-ACTION-TERMINATE" and that terminates the accept of the active-x control.

Hope this helps you some.

Rob
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Is it possible as to send a terminate-event when using an active-x control.

Rob,

At this moment the EVENT-ACTION-TERMINATE won't work.

I use a screen section, but the active-x control is displayed by
DISPLAY @ActiveExample
LINE 2.5, COL 1.2, LINES CT-LINES, SIZE CT-SIZE,
ID = ID-ActiveExample,
LICENSE-KEY IS ActiveExample-license-key
HANDLE IN H-ActiveExample,
EVENT Event-Handler-ActiveExample.

I think that this is the reason why the terminate event won't work.

To skip any event's I use a switch to skip actions in the event section. (jump to the end of the event section of the active x control). I'm not 100% sure if that is what you mean whit 'disable events'.

Thanks

Ed.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Is it possible as to send a terminate-event when using an active-x control.

Ed1,

I am using ActiveX controls in the same way you are (with a DISPLAY instead of screen section), however the terminate accept works for me... Do you accept the control?

Anyhow, what I meant by "disable" events is exactly what you are doing. So, all is well for you now?

Rob
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Is it possible as to send a terminate-event when using an active-x control.

Indeed the event-action-terminate works.
Which of course makes the use of active-x events much simpler.

Thanks.

Ed.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.