Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29252 ディスカッション

Defining an overloaded function in a DLL

jond
初心者
671件の閲覧回数
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 件の賞賛
3 返答(返信)
Steven_L_Intel1
従業員
671件の閲覧回数
Yes - you don't DLLEXPORT the overloaded function itself, but rather each of the module procedures that implement the function for each signature.
jond
初心者
671件の閲覧回数
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
Steven_L_Intel1
従業員
671件の閲覧回数
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.
返信