extern void __stdcall FORTRANFUNCTION(const double *array1, const double *scalar1 [, etc.]); // Since FORTRAN typically expects arguments by reference, arguments are passed // as pointers. To pass values, the FORTRAN code must contain a compiler directive // telling the function to expect a value rather than an address. LRESULT mcadfunction(LPCOMPLEXARRAY array1, LPCCOMPLEXSCALAR scalar1, etc.)
// this defines the function before FUNCTIONINFO, using the same variable names // called by the external FORTRAN function. { // some error checking goes here, followed by the // actual call to the FORTRAN function. For example, FORTRANFUNCTION(&array1->hReal[0][0], &scalar1->real [, etc.]);
// Either the function call must be in UPPERCASE, or you will have to set // Settings->FORTRAN->External procedures->External name implementation // to "Upper case" in your FORTRAN compiler. Any other C functionality follows... return 0;
}
ライブラリ内のリンク
1. MS Visual C++ または Visual Studio で既存の C プロジェクトを開いて「Linker」タブを選択し、次に「Category」メニューで「Input」を選択します。[myfortranlib].lib をリストの最後の Object/library modules テキストボックスに入力します。