Skip to main content

I am trying to access .NET class properties/methods from ACUCOBOL (Micro Focus extend runtime version 10.3.0)

I have built and registered my .dll

I have used NetDefGen to extract the access points in the .dll

When i try to Create my Object in acucobol it returns a zero handle

 CREATE "@myAssembly"
         NAMESPACE IS "myStringer"
         CLASS-NAME IS "Stringer"
         CONSTRUCTOR IS CONSTRUCTOR1()
         HANDLE IS MY-NONGUI-HANDLE.

Attached source and batch files to build the project

Any help is greatly appreciated

I am trying to access .NET class properties/methods from ACUCOBOL (Micro Focus extend runtime version 10.3.0)

I have built and registered my .dll

I have used NetDefGen to extract the access points in the .dll

When i try to Create my Object in acucobol it returns a zero handle

 CREATE "@myAssembly"
         NAMESPACE IS "myStringer"
         CLASS-NAME IS "Stringer"
         CONSTRUCTOR IS CONSTRUCTOR1()
         HANDLE IS MY-NONGUI-HANDLE.

Attached source and batch files to build the project

Any help is greatly appreciated

Where are the .Net dlls located? Have you tried placing the .Net dlls in the same directory as the runtime wrun32?


Where are the .Net dlls located? Have you tried placing the .Net dlls in the same directory as the runtime wrun32?

Yes. If you download the .zip there is a batch file for building the .dll.

If you want i can post the .dll.

Copying the .dll to the acucobol bin directory produced the same results


Yes. If you download the .zip there is a batch file for building the .dll.

If you want i can post the .dll.

Copying the .dll to the acucobol bin directory produced the same results

The buildacu.bat has run32  .. have you renamed or rebuilt the runtime? On Windows our runtime is wrun32.

When you ran the builddll.bat, was the command window run as Administrator?

I was able to make the dll - set PATH=%PATH%;C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727

I compiled the cobol.cbl - ccbl32 -ga  -sp . cobol.cbl

I placed the MyAssembly.dll into the runtime bin directory.

I executed in debug - wrun32 -dle xx cobol.acu .. The Create works and the Inquire returns data


The buildacu.bat has run32  .. have you renamed or rebuilt the runtime? On Windows our runtime is wrun32.

When you ran the builddll.bat, was the command window run as Administrator?

I was able to make the dll - set PATH=%PATH%;C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727

I compiled the cobol.cbl - ccbl32 -ga  -sp . cobol.cbl

I placed the MyAssembly.dll into the runtime bin directory.

I executed in debug - wrun32 -dle xx cobol.acu .. The Create works and the Inquire returns data

Yes. That was the problem. I have no idea where i got run32 from. Using wrun32 worked fine.
Thank you very much for your help. I appreciate it