Highlighted
Absent Member.
Absent Member.
389 views

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

Jump to solution

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? 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

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

Jump to solution
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

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

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

Jump to solution
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

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

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

Jump to solution
Worked like a champ. I had never explored those attributes of a project.
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.