Creating and Passing .NET Objects as Parameters

ACUCOBOL-GT programs can retrieve .NET objects or pass .Net objects as parameters. These .Net objects can also be acted upon using the MODIFY and INQUIRE statements.

.Net objects are supported by identifying them as belonging to a generic namespace of "MICROFOCUS" and class "NETOBJECT". a COBOL program that wants access to .NET objects must have defined the @MICROFOCUS.NETOBJECT in the special names paragraph.

.Net objects must be stored in a data type identified by "USAGE HANDLE OF OBJECT". If you wish to invoke MODIFY and INQUIRE statements for certain GET/PUT properties or methods on the .Net object, you need to create the equivalent COBOL definitions as part of the @MICROFOCUS.NETOBJECT namespace/class. You can create the def file for this generic object with NetDefGen.

Limits and Restrictions

  • .NET objects cannot be created in your COBOL program. They are only retrieved or passed as a paramter.
  • Overloaded methods are not supported with .NET objects. Only one definition may be used.
  • .Net objects cannot be retrieved or passed if they are part of an array/list.
  • .Net objects cannot be retrieved from events using the C$GETNETEVENTDATA library routine.
  • .Net objects as parameters are not supported when using the runtime switch - -a2n