Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Dagl Absent Member.
Absent Member.
1333 views

Calling .NET dll created with --netdll compiler switch

Hi

I have created a test project to test the "--netdll" compiler switch. I have the .dll and the _CVM.dll files created, and can reference them correctly into my VC project. I can also build the VC project without errors. But when calling one of the entry points, or the main, I only get an exception (I put the call in a try - catch - setting) saying "Index was outside the bounds of the array."

I have now tested one COBOL program that i have made on my own, and I have tried copy / paste of the COBOL program + the C# code in the sample from the documentation. Both are returning the same exception.

I dont think the excecution is even getting to the code inside the COBOL .dll

I think the exception is triggered in the call before it gets so far.

Have anyone got this working?

Regards Dagl

Tags (1)
0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

RE: Calling .NET dll created with --netdll compiler switch

Your Visual Studio (version #) has AcuGT Objects reference and that it is resolved? You have the atest.cbl compiled and in the AcuGT\bin directory? You have the AcuGT runtime license in the AcuGT\bin directory?

0 Likes
Dagl Absent Member.
Absent Member.

RE: Calling .NET dll created with --netdll compiler switch

Hi!

I also raised this as an incident, and got answer for your support department. I had the wrong compiler version.

I now have had the sample program running.

But I look at the sampel code. Does this mean that you need a AcuCobol runtime to use this .dll`s ?

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Calling .NET dll created with --netdll compiler switch

Yes, the CVM loads the Acu runtime. The dll you'made with our compiler is a file created to load the runtime and COBOL program, and the CVM is how we allow C# or other Microsoft languages access to the COBOL. Your COBOL program may do Open FILE-NAME, but the runtime is what gets the O/S to actually open the file.

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.