Highlighted
Absent Member.
Absent Member.
563 views

[archive] Help Using Non-Visual ActiveX

[Migrated content. Thread originally posted on 08 August 2006]

I am trying to use a non-visual activex control from ComponentOne called XArrayDB. I created the def file with axdefgen (attached), and added it to my workspace copylib, then I added it to the cbl program (below)...
SPECIAL-NAMES.
COPY "XArrayDB.def".
*{Bench}activex-def
COPY "TDBList.def".
COPY "Acuclass.Def".
.

Also Added...
77 XArrayDB-Handle USAGE IS HANDLE.

Then I added some event procedure code to create it (below)... but when I try to call the AboutBox method just to be sure it's working, I get a compiler error "Undefined data item: @ABOUTBOX"
CREATE @XArrayDB OF @XArrayDBObject
HANDLE IN XArrayDB-Handle.
MODIFY XArrayDB-Handle @AboutBox().
0 Likes
7 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Using Non-Visual ActiveX

I think I figured that part out... I changed:
77 XArrayDB-Handle USAGE IS HANDLE.
to
77 XArrayDB-Handle USAGE IS HANDLE OF @XArrayDB.

Now, when I compile, the methods and properties are recognized.

New problem... After I compile and run that program, something gets corrupted and I cannot open the project again...AcuBench just crashes... I have to remove the program from the project and create a new program... and redo everything... and the same thing just happends again.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Using Non-Visual ActiveX

Is there no sample that shows proper syntax for creating and manipulating ActiveX controls that are dropped onto the screen from the toolbox?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Using Non-Visual ActiveX

It crashes when I close and attempt to reopen the Screen/Form... so long as I don't close/reopen the form, I can keep modifying, compiling, and running. But I still can't get the control to work... you're supposed to be able to create an instance of XArray, dimension it, set values, then associate it with their Listbox control and the list manages itself using the XArrayDB object as the data source. I can get everything to run, but nothing seems to happen. I'm just wondering if there's an incompatibility with AcuCOBOL... I'm not sure where to put the code, so I've been trying it in a button "Form1-Pb-1-Ex-Cmd-Clicked" event... but here's what it looks like:
*
Form1-Aft-Create.
CREATE @XArrayDB HANDLE IN XArrayDB-Handle.
.
*
Form1-Ex-Cmd-Close.
DESTROY XArrayDB-Handle.
.

*
Form1-Pb-1-Ex-Cmd-Clicked.


MODIFY XArrayDB-Handle
@Redim(0,1,0,1)
@Set(0,0,"Row1,Col1")
@Set(0,1,"Row1,Col2")
MODIFY Form1-TDBL-1
@Array(XArrayDB-Handle)
@ApproxCount(45)
@ReBind()
@Refresh().
.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Using Non-Visual ActiveX

Well. Primary error is; IF this is a windowless ActiveX, you should not use the CREATE verb, but the DISPLAY verb to create it. CREATE is for COM objects, they share many things with Activex, but there are some fundamental differences too, which will cause your control to die when not invoked properly.

You can tell whether it is ActiveX by searching the .DEF file for the tag PRIMARY-INTERFACE. If this group also have the tag ACTIVE-X-CONTROL, then you know you have an activex. If not, you have a COM object. Searching this file, you will find it is an ActiveX, so replace your CREATE with DISPLAY, and you should get further.

In case of the latter, there ain't much help to get in Acubench, as it is not for all IDEs. Most IDEs, including Acubench have lots of support on how to deal with Activex, but COM is a totally different story. Best advise I can give here is to read examples or even better attend our extensive training on this. We have a worldwide training taking place this fall. Go have a look at our website at http://www.acucorp.com/events, Look for "Advanced Windows Development with ACUCOBOL-GT" and see if there is something near you. There are four events in Europe, two in the US and one in South Africa.

A question at the end; May I ask why you want to use this table? Is it to get a Variant SafeArray? ACUCOBOL-GT has native support for that.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Using Non-Visual ActiveX

The DEF file I attached to this post shows it as an ActiveX... but when I attempt to create it with DISPLAY, I get an "error creating ActiveX" message from the runtime. Perhaps I don't have the proper syntax, or perhaps I don't have it in the correct precedure section. I was just trying to put it in Form1-Aft-Create.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Using Non-Visual ActiveX

but when I attempt to create it with DISPLAY, I get an "error creating ActiveX" message from the runtime


It is a few things it can be, but assuming you just replace CREATE with DISPLAY, I figure that should be okay. The next thing then, is licensing. Do you have a designtime/runtime license available for the control? Do you know if it requires it?

But you know, as this issue cannot be answered in a couple of emails, I would suggest you bring the topic to Tech Support.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Using Non-Visual ActiveX

When I was using the CREATE... and added the LICENSE-KEY statement, I actually got the "nag screen"... from the control. However, when I omitted the LICENSE-KEY, I did not key the nag screen... this seemed backwards, so I was a little confused. I have not tried using the LICENSE-KEY with the DISPLAY statement. I will try that. Also, I do have an issue opened with tech support, but I don't think I'm getting to the right people... perhaps I need to request that my rep kick it up to a developer. No offense... I realize every tech support rep can't know everything about everything... but I think need someone who had in-depth knowledge on activex interaction with the runtime.
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.