The following summarizes how to reconcile names between languages:
If you call a Fortran routine that uses Fortran defaults and cannot recompile the Fortran code, then in C and Visual Basic you must use an all-uppercase name to make the call. In MASM you must either use an all-uppercase name or set the OPTION CASEMAP directive to ALL, which translates all identifiers to uppercase. Use of the __stdcall convention in C code or STDCALL in MASM PROTO and PROC declarations is not enough, because __stdcall and STDCALL always preserve case in these languages. Fortran generates all-uppercase names by default and the C or MASM code must match it.
For example, these prototypes establish the Fortran function FFARCTAN(angle) where the argument angle has the ATTRIBUTES VALUE property:
extern float __stdcall FFARCTAN( float angle );
Declare Function FFARCTAN Lib "C:\f90ps\FBAS.DLL" (ByVal angle As Single) As Single
.MODEL FLAT, STDCALL
FFARCTAN PROTO STDCALL, angle: REAL4
...
FFARCTAN PROC STDCALL, angle: REAL4
If the name of the routine appears as all lowercase in C or MASM, then naming conventions are automatically correct when the C or STDCALL option is used in the Fortran declaration. Any case may be used in the Fortran source code, including mixed case since the C and STDCALL options change the name to all lowercase. You cannot call a Visual Basic routine from Fortran directly (see Fortran/Visual Basic Mixed-Language Programs), so Basic routine names are never translated.
If the name of a routine appears as mixed-case in C or MASM and you cannot change the name, then you can resolve this naming conflict by using the Fortran ATTRIBUTES ALIAS option. ALIAS is required in this situation because otherwise Fortran will not preserve the mixed-case name.
To use the ALIAS option, place the name in quotation marks exactly as it is to appear in the .OBJ file. The following is an example on ia32 systems for referring to the C function My_Proc:
!DEC$ ATTRIBUTES ALIAS:'_My_Proc' :: My_Proc
On ia64 systems, this would be coded without the leading underscore as:
!DEC$ ATTRIBUTES ALIAS:'My_Proc' :: My_Proc