The problem is how to access information in a common block, by using a callback subroutine from a DLL. On Linux all is well, but on Windows, the values of the common block are 0. Consider the following calling sequence:
--> cycler (defined in aa.lib)
--> eout (subroutine defined in bb.dll)
--> get_info (call back into aa.lib)
--> get_number(defined in aa.lib)
suborutine cycler has a common block with a variable "inum". Subroutine cycler calls a subroutine eout. eout is compiled/linked into bb.dll. Subroutine eout has a call to subroutine get_info and it calls subroutine get_number. The last two are compiled and linked into the same static library as cycler. Therefore we call it a callback, because eout makes a call back into the library. Subroutine get_number also has the same common block as cycler with variable inum. As it turns out, inum is zero at this level. But in cycler it still has a good value of 24.
The question is what do I need to do to make it work? I read about importing and exporting of common blocks, but it seems to me that nothing needs to be imported/exported as all is defined in the same static library. Any help is greatly appreciated.