My initial test for this issue is as follows
C function...
#include <stdio.h>
extern 'C' void __stdcall PassIntegers(char i1Arg, short i2Arg, int i3Arg)
{
printf('%d\\n', i1Arg);
printf('%d\\n', i2Arg);
printf('%d\\n', i3Arg);
}
Fortran program...
program test
STDCALL PassIntegers 'PassIntegers'(VAL,VAL,VAL)
integer*1 i1
integer*2 i2
integer*4 i3
i1 = 7
i2 = 45
i3 = 19
call PassIntegers(i1,i2,i3)
end program test
This works OK and I don't know how I can progress from here.
When you compile a function/subroutine using FTN95, arguments are always passed (in) by reference but you can pass arguments (out) by value from FTN95 when the function/subroutine is compiled using some other compiler such as SCC.