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

EXE LINKED TO DLL: How to link an include file from exe to dll

Deleted_U_Intel
Employee
395 Views

This is a very important issue. When I am creating a dll and put common blocks that I want to be linked to the same common block in my exe program, the commmon block information does not pass from the exe to the dll. I have near thousand of parameters that need to be passed to the dll and of course passing the arguments (which is working) is not a solution.

How can I use common block (or an include file) in both the main exe and any dll and having the information passing?
This is a basic question for any developer that needs to have tons of arguments passing in one single shot.

The dll is needed because the user writes his own code in the dll type of project while the exe is maintained by the developer.

If you haev a solution, pelase send me a simple example.
thanks in advance

0 Kudos
2 Replies
ArturGuzik
Valued Contributor I
395 Views

Hi,

I'm not sure I fully understand your problem, however, I can point you to IVF Help files, "Coding Requirements for Sharing Data in DLLs", "Exporting and Importing Common Block Data", where example of appropriate DLLEXPORT directive is included and described. You can also find on-disk example (source code) in SamplesFortranDLL directory of the compiler installation directory tree. Searching this Forum will/should also bring up several threads related to the issue.

A.

0 Kudos
jimdempseyatthecove
Honored Contributor III
395 Views


guzy,

Have you considered using a module containing auser defined type to hold the context (currently in a common or include file). Then pass the single reference into the DLL?

Jim Dempsey

0 Kudos
Reply