Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28652 Discussions

Defining an overloaded function in a DLL

jond
Novice
389 Views
Hello,

Is it possible to DLLEXPORT an overloaded function from a DLL? If it is possible, how do I do it?

Thanks for any help,
Jon
0 Kudos
3 Replies
Steven_L_Intel1
Employee
389 Views
Yes - you don't DLLEXPORT the overloaded function itself, but rather each of the module procedures that implement the function for each signature.
0 Kudos
jond
Novice
389 Views
Thanks, Steve. So, when I use the overloaded function name outside the DLL, Fortran knows which of the actual functions to use. Can I expect the same behavior if I call the overloaded function from a VB.NET application? Or will VB stall in this case?

Jon
0 Kudos
Steven_L_Intel1
Employee
389 Views
When you USE the module in a Fortran program, the compiler knows about the individial specific procedures and their global names, so that's why you DLLEXPORT them.

If you are calling from a non-Fortran language, it has no concept of Fortran overloading - you have to tell it the exact exported name of the routine to call, which will be one of the specific procedures. You'll need to know how the compiler decorates that name unless you add an ALIAS attribute.
0 Kudos
Reply