In the past I have integrated C & C routines with the AcuGT runtime by simply creating a DLL and calling the routines. Now I need to integrate some C# .NET code. Clearly it's a whole new world.
I have read the relevant parts of the manual and have had some help from MF tech support, but some questions remain.
1. If my method returns an Int32, how is that accessible in the Cobol program? Does RETURN-CODE reflect it?
2. The example program implies Cobol can pass a .NET System.String to a method (BTW it would be really helpful to see the .NET code that corresponds to this example). Is this true - can I pass a Cobol string to a .NET method as a System.String object? How exactly is that done?
3. Closely related question: How can the .NET method return a string? If I pass a System.String per #2, could the .NET method modify and return it? (seems unlikely because a .NET System.String is immutable).
4. The main thing my methods need to do is parse and modify Cobol record buffers, containing a mix of strings, numeric values, COMP-3, COMP-4, etc. I am working on the assumption that these can't be passed as strings because they aren't strings. Currently my C# routine is expecting an IntPtr, a pointer to a block of "unmanaged memory", that it will then move to a byte[] array and parse out. I am hoping to use the same method to return such a block. How would I code the Cobol to pass a record structure (FD) as an IntPtr ? Or, is there a better way?
Many thanks for any insights into all of this.
#.net



