Interlanguage Calling Considerations

  1. To ensure that your RPG procedure will communicate correctly with an ILE CL procedure, code EXTPROC(*CL:'procedurename') on the prototype for the ILE CL procedure or on the prototype for the RPG procedure that is called by the ILE CL procedure.
  2. To ensure that your RPG procedure will communicate correctly with an ILE C procedure, code EXTPROC(*CWIDEN:'procedurename') or EXTPROC(*CNOWIDEN:'procedurename') on the prototype for the ILE C procedure or on the prototype for the RPG procedure that is called by the ILE C procedure. Use *CNOWIDEN if the ILE C source contains #pragma argument(procedure-name,nowiden) for the procedure; otherwise, use *CWIDEN.
  3. If you want your RPG procecure to be used successfully by every ILE language, do not specify any special value on the EXTPROC keyword. Instead, avoid the following types for parameters that are passed by value or return values:
  4. RPG procedures can interact with ILE C/C++ procedures that use 8-byte pointers. However, the ILE C/C++ procedures must use 16-byte pointers for parameters. See the IBM Rational Development Studio for i: ILE C/C++ Compiler Reference.
  5. RPG file parameters prototyped with the LIKEFILE keyword are not interchangeable with file parameters from other languages. For example, you cannot pass an RPG file to a C function that is expecting a FILE or RFILE parameter. Similarly, a C function cannot pass a FILE or RFILE parameter to an RPG procedure if the RPG parameter was prototyped with the LIKEFILE keyword.


[ Top of Page | Previous Page | Next Page | Contents | Index ]