Highlighted
Absent Member.
Absent Member.
939 views

[archive] Passing Active-x control as a parameter to another program

[Migrated content. Thread originally posted on 18 February 2004]

I've got an active-x control defined in the screen section of my program and everything works OK. Now I would like to pass this control to a separate program for processing.

My problem is I don't know how to pass it to the other program. Do I need to take it out of the screen section and use "DISPLAY object... handle is handle-var"?

Thanks,
Clay Haller
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Passing Active-x control as a parameter to another program

ActiveX components are tied to their Window and thread, so you cannot pass them over to other COBOL programs. This limitation is by design.

If the component was a COM object on the other hand, it would be independent and could be passed around, see WordMailMerge.cbl example for an example of this.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Passing Active-x control as a parameter to another program

Thanks, Gisle
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Passing Active-x control as a parameter to another program

Correction.

I was wrong, or at least partly wrong 😉

What I meant to say that you could not do, is to display a Window in program A, call program B and pass the handle of the window, using this handle to create an Activex in program B onto the window of program A. THAT will cause trouble.

On the contrary, if you create a window and display an ActiveX onto this in program A, then call program B giving the handle of the ActiveX you made in program A, program B may use this handle.

Note that you will have to include the .def file in both program A and B. This will cause a significant overhead when debugging, but for the final release there won't be as the compiler abandons unused stuff.

My compliments to Davide Spizzi from Acu Italy for correcting me here.

Davide, would you mind post your calendar sample illustrating this?

Sorry for my wrongdoing.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Passing Active-x control as a parameter to another program

Thanks! That is what I'm looking for.

Clay
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.