native COBOL calling object

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!

  • Verified Answer

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