Highlighted
Absent Member.
Absent Member.
1153 views

calling registered COM objects from managed code

Jump to solution

Hi, I'm new to Visual Cobol (I have Version 2.1 Upgrade with Visual Studio 2012 running in Windows 8).

In Net Express I used an OO program to call registered COM objects.

Using VC (Form Designer) I have made references to these objects: They are described as Interop.ObjectName, Type ActiveX.

But, I haven't found any explanation or instructions on how to code  these objects and call their entry points.

I'd appreciate some help on the subject.

0 Likes
2 Solutions

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: calling registered COM objects from managed code

Jump to solution

In a Visual COBOL native program you can use the same OO client classes to call COM as you did in Net Express.

From a managed code program, after you add a reference to these COM servers you would just create a new instance of the server and call its methods like any other OO class.

Intellisense should show you the available methods and the expected parameters.

What ActiveX/COM servers are these?

An example of a managed COBOL application calling the Excel COM Server can be found here:

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: calling registered COM objects from managed code

Jump to solution

Thank's Chris,

the COM servers are Customer made. 1 (SAP interface) in VB, the other (Elreco number plate recognition system) in C.

Your answer pushed me in the right direction after I had stumbled into an unnecessary Wrapper to call my old dll.

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: calling registered COM objects from managed code

Jump to solution

In a Visual COBOL native program you can use the same OO client classes to call COM as you did in Net Express.

From a managed code program, after you add a reference to these COM servers you would just create a new instance of the server and call its methods like any other OO class.

Intellisense should show you the available methods and the expected parameters.

What ActiveX/COM servers are these?

An example of a managed COBOL application calling the Excel COM Server can be found here:

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: calling registered COM objects from managed code

Jump to solution

Thank's Chris,

the COM servers are Customer made. 1 (SAP interface) in VB, the other (Elreco number plate recognition system) in C.

Your answer pushed me in the right direction after I had stumbled into an unnecessary Wrapper to call my old dll.

View solution in original post

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.