Highlighted
Super Contributor.
Super Contributor.
741 views

native COBOL calling object

Jump to solution

Hi,

Using Miicro Focus native COBOL in Visual Studio, I want to call an object, but I don't know how to reference it (it has been registered). in Visual Studio.

Very similar to what I did, with much help, in Netexpress, where I had to add a reference under Type Assistant.

 Thanks!

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: native COBOL calling object

Jump to solution

Hi Fran,

The native to managed interface in Visual COBOL is the same as it is in Net Express. You would register your .NET assembly for use with COM Interop and then you would use the native OO COBOL support for calling a COM library.

In Visual COBOL you do not have the Type Library Assistant like in Net Express but the name of the class would be the name of the namespace and class of the .NET class you are calling. If you have NX installed on the same system you could use the Type Library Assistant and use the generated code in Visual COBOL.

Example:

In you .NET class you have:

class-id testVCServer.VCCOMServer.

In your native client you would use:

     $set ooctrl(+p)
      id division.
      program-id.  VCCOMClient.
      class-control.
          VCCOMServer is class "$OLE$testVCServer.VCCOMServer".

View solution in original post

0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: native COBOL calling object

Jump to solution

Hi Fran,

The native to managed interface in Visual COBOL is the same as it is in Net Express. You would register your .NET assembly for use with COM Interop and then you would use the native OO COBOL support for calling a COM library.

In Visual COBOL you do not have the Type Library Assistant like in Net Express but the name of the class would be the name of the namespace and class of the .NET class you are calling. If you have NX installed on the same system you could use the Type Library Assistant and use the generated code in Visual COBOL.

Example:

In you .NET class you have:

class-id testVCServer.VCCOMServer.

In your native client you would use:

     $set ooctrl(+p)
      id division.
      program-id.  VCCOMClient.
      class-control.
          VCCOMServer is class "$OLE$testVCServer.VCCOMServer".

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.