Cannot invoke project. A simple coding problem in 2017 Visual Studio

The code I used came from the COBOL training class and allows one project to initiate another project. There must be some feature that initiates this capability. The code follows; 

method-id button5_Click final private.
local-storage section.

* invoke project for final processing

01 newForm type AlterMenu.Form1.
procedure division using by value sender as object e as type System.EventArgs.
Invoke type AlterMenu.Form1::New() returning newForm
Invoke newForm::Show()

end method.

The project details are

A second part of my problem is, what is the best way to pass information between projects? 

  • Verified Answer

    You are not actually invoking the project but you are invoking a method on a class in the output assembly which is generated from the project. In order to do this you first need to add a project reference to the invoking project.
    Right-click on the References folder in the Load Score Sheet project and select Add Reference and then expand the arrow next to Projects and select the AlterMenu project.

    As far as passing information there are many ways to do this. You can define properties in the working-storage of your class and then set them or retrieve them from the invoking class or you can define methods that take parameters that you can pass in and return. If you wanted to pass information when calling the new method then you can create a version of New that takes the parameters in its signature.

    Thanks
  • Worked like a champ. I had never explored those attributes of a project.