This sample demonstrates usage of Windows* Win32 APIs LoadLibrary and GetProcAddress to dynamically load a DLL, look up a routine, and call the routine. This program also illustrates use of Fortran 2003 features such as abstract interfaces and procedure pointers.

In this sample, the program will load a DLL called USERDLL and look for a routine called USERFUNC.  This function must accept an integer argument and return an integer result.  If the function is found, it is called ten times with arguments 1-10, and the result displayed.  At the end, the library is unloaded.

For more information about using DLLs, see Creating and Using DLLs in Using Intel Visual Fortran to Create and Build Windows-Based Applications

System Requirements

Minimum requirements include a PC based on an IA-32 or Intel® 64 architecture processor supporting the Intel® Streaming SIMD Extensions 2 (Intel® SSE2) instructions (Intel® Pentium® 4 processor or later, or compatible non-Intel processor), and supported versions of the Microsoft Windows* operating system, Microsoft Visual Studio*, and the Intel® Visual Fortran compiler. Refer to the Intel® Parallel Studio XE product Release Notes for details on the complete system requirements.

Build Instructions

The sample is provided as a Microsoft Visual Studio* solution and also contains a command-line build script build.bat file. The build.bat file accepts an optional command-line argument from the following list: