Created On:  14 December 2012

Problem:

What is the safe maximum number of parameters that can be passed to a COM object from an unmanaged COBOL program?

Resolution:

Any application that call a COM componment needs to be built with the OOCTRL(+P) compiler directive. This directive limits the number of parameters passed on an invoke to 31.

If an application passed more than 31 then an RTS114 or RTS252 runtime error may result.

To work round this limitation you can design the COM method so that is accepts another COM object as a parameter. The parameters can be set as properties on this object that is passed. Alternatively properties could be exposed on the COM object and set before the invoke is made to the method.

Incident #2597978