Highlighted
Absent Member.
Absent Member.
1740 views

[archive] Wrunnet

[Migrated content. Thread originally posted on 01 August 2006]

Is there someone that has a sample using wrunnet from dotnet to initialize, call and cancel a program.
Thanks for any info
Flavio
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Wrunnet

Have you checked out the sample \AcuGT\sample\NetToAcuCobol
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Wrunnet

I have verified but in all samples there is no example using wrunnet.dll, but it uses the acugt objects
Flavio
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Wrunnet

I have implemented wrunnet.dll as follows:


    • add a reference to wrunnet.dll to my .NET project
    • instantiate a CVM object (i.e. private CVM myCVM = new CVM)
    • set the ConfigFile property to point to my ACUCNFG.SQL file (i.e. myCVM.ConfigFile = "C:\ACUCNFG\ACUCNFG.SQL")
    • invoke the Call method on the CVM (i.e. myCVM.Call(, , , ))
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Wrunnet

With the 7.2.0 release there is a sample program that demonstrates using wrunnet.dll.

It can be found in the directory:
\Acucorp\Acucbl720\AcuGT\sample\wrunnetutil

The sample is in the format of a Visual Studio 2003 .NET Project.

Here is a smaller sample of calling the wrunnet.dll from C#:

[HTML]
using System;
using acucobol; // this namespace is in wrunnet.dll. Added in references (Add reference)

namespace NetSample
{
public class NetSample
{
public CVM acuCobol;

public NetSample() // constructor
{
// Instantiate the Cobol Virtual Machine Class
// See Object Browser wrunnet, namespace acucobol, class CVM
acuCobol = new CVM();
}

// Set Acucobol Runtime Properties and call Initialize
public bool InitAcuCobol(string RuntimeParams)
{
// You can set runtime options using properties and or a string
// containing runtime command line options.
// You can mix both types, parameter string and properties.
// If you use only properties you can call Initialize without
// a parameter string. acuCobol.Initialize();

acuCobol.ListConfig = true;
acuCobol.Debug = true;
acuCobol.ErrorsOut = "c:\\temp\\error.log";

acuCobol.Initialize(RuntimeParams);
return true;
}
// execute an Acucobol program
public bool ExecuteCobolPgm(string PgmName )
{
// This holds parameters for cobol linkage section and entry params
// See Documentation
object [] paramObjects = null;

// See Documentation
byte [] cblTypes = null;

// See Documentation or Onject Browser for values
acucobol.errorTypes rtn;

int CobolReturnCode = 0;

rtn = acuCobol.Call(PgmName,
ref paramObjects,
ref cblTypes,
null,
ref CobolReturnCode);
return true;
}
// Stop the runtime
public bool StopAcuCobol()
{
acuCobol.ShutDown( 0 );
return true;
}
}
}
[/HTML]
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.