Absent Member.
Absent Member.
2025 views

Visual Cobol - Visual Studio

Jump to solution

[Migrated content. Thread originally posted on 06 October 2011]

Ok can some one pls advise if this scenario is possible?

I am using Visual Cobol & Visual Studio 2010.

Can I create a Winform Visual Cobol project that can call a Visual Studio VB 2010 project with a call parameter and then return a different value which I can capture in the Visual Cobol project?

Thanks

Neil.
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert
OK Neil, I sent this to your e-mail address.

View solution in original post

0 Likes
7 Replies
Micro Focus Expert
Micro Focus Expert
If you have a VB.NET class in one project and a COBOL .NET in another project you can create a new instance of the VB class in COBOL and then invoke its methods while passing parameters to and returning parameters from the method.

All you need to do is add a reference to the VB project in the COBOL project by right clicking on references under the COBOL project and selecting Add Reference.

Then select the projects tab, and select the VB project from the list.

Is this what you are looking for or am I missing something here?
0 Likes
Absent Member.
Absent Member.
Hi Chris,

Well that sounds right, if there an example of this I can download to try?

Thanks

Neil.
0 Likes
Absent Member.
Absent Member.
The sample 'InterfacingWithStdCOBOL' shipped with the product demonstrates a number of ways of connecting COBOL with other .Net languages (in this case C#).

In the case you describe, the VB.Net WinForm project would need a project reference to the COBOL.Net project, and then intellisense should just work in the VB.Net code, allowing you to create a COBOL class, invoke methods on it, and gather returned values.


0 Likes
Absent Member.
Absent Member.
thanks for info.

i found the project in question, but it wont run can you pls advise how to run this demo?
0 Likes
Micro Focus Expert
Micro Focus Expert
The demo uses various console main programs that call COBOL to show how parameters are passed.
To run each one you need to make that project the Startup project by right clicking on the Project name and selected Set as Startup Project.

Step into the program using F11 in order to debug it.

I tried to attach a sample program to this post but it is giving me an error at the present time.
If you give me your e-mail address I will send it directly to you.

It demonstrates a simple COBOL Winform calling a VB program and passing a string parameter as reference.

Hope this helps.
0 Likes
Absent Member.
Absent Member.
Thanks Chris that would be great if you could send me a simple demo program.

My email address is neil@eurorealm.co.uk
0 Likes
Micro Focus Expert
Micro Focus Expert
OK Neil, I sent this to your e-mail address.

View solution in original post

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.