Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello:

I'm developing an application that integrates an API from a controller supplier.
I've been able to do almost everything except a small part and for that I ask for your help.

I have already talked to the API / DLL programmer and what is really missing is setting the event so that when a procedure occurs it does.
What is programmed and what you need to convert is the following:

EVENT DEFINITION:
_NuxIO.ValueEnteredEvent + = new NuxIO.ValueEnteredEventHandler (OnValueEnteredEvent);

PROCEDURE TO BE PERFORMED WHEN THE EVENT IS DETECTED:
Private void OnValueEnteredEvent (object sender, ValueEnteredEventArgs e)
{
If (e.Type == 2) ListBox.Invoke ((MethodInvoker)) => listBox.Items.Add ("IP:" + e.IPAddress + "RS232:" + e.Value)));
If (e.Type == 3) ListBox.Invoke ((MethodInvoker)) => listBox.Items.Add ("IP:" + e.IPAddress + "I8 Activated")));
If (e.Type == 4) ListBox.Invoke ((MethodInvoker)) => listBox.Items.Add ("IP:" + e.IPAddress + "I7 Activated")));
}

So I guess it does not take much time to complete the process.
I look forward to your help.

Thanks
Alberto Ferraz

What I have tried:

I've tried several options but I could not find the right formula.
Posted
Updated 13-Jul-17 4:17am
Comments
Richard MacCutchan 13-Jul-17 10:12am    
What is the problem?

1 solution

Visual COBOL Personal Edition | Micro Focus[^]

I used to work for this company. It was years ago so a lot has changed but they made Visual COBOL so you can flip between COBOL and C# / VB.

It compiles out to .Net IL, but it might be useful to you.

The problem you will find is that everyone wants to get away from COBOL. It's old, doesn't integrate, and reads horribly compared to more modern languages.

At the very least, the VC PE from MicroFocus would let you use C# with your COBOL code
 
Share this answer
 
Comments
Member 12140334 13-Jul-17 10:33am    
But I'm using Visual Cobol for Visual Studio (V 2.3).
I have to see this situation of VC PE.

But here the question is that the instructions are similar and the parameters are the same but some instructions are harder to "convert" because of their format.

Can you give some tips?
Andy Lanng 13-Jul-17 10:43am    
Visual Cobol for Visual Studio (V 2.3)? ha ha - that's prolly the same guys :)
If you have one then don't worry about PE.
I don't understand why you want your C# code in COBOL code, tho. Create a C# class library project and add your C# code there. Reference the classes in your COBOL then just call the methods
Member 12140334 13-Jul-17 11:07am    
But I do not want C # code in my cobol program.

As I was not able to perform all communication functions with the API I asked the vendor and he sent me the source of a test program.

So I checked what I was missing and so I need to convert the command in C # to Cobol. I think it will be easier than creating a class as suggested.

I have to execute a command to "communicate" with the API and as I have the source of a test program that works with the API I checked what is missing and is what I indicated in the first post.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900