Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

.NetCobol invoking a C# method. Error COBCH0829.

$
0
0

.Net Cobol class:

      $set ilusing "CSharpPrograms"

       class-id. CobolMain.

       method-id. main public.

           invoke type Console::WriteLine("CobolMain: Hello World")

           invoke type CSharpSub::DisplayMethod()

       end method main.

       end class.

  

C# Class:

 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

 

//  This is an experiment of calling a C# program from a Cobol main program.

 

namespace CSharpPrograms

{

  public class CSharpSub

  {

    public void DisplayMethod()

    {

      Console.WriteLine("CSharpSub: Hello World");

    }

    static void Main()

    {

    }

  }

}

  

When building, I get the error below in the Cobol class.  I have tried many things.  Is there some special Cobol syntax I am not using?  Thanks.

 

Error 1     COBCH0829: Could not find method 'DisplayMethod' with this signature


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>