<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DLL Question in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/DLL-Question/m-p/966649#M23046</link>
    <description>Thanks for your help guys,  I got it working later that day. I am not sure what I changed, but the COMMON blocks are correctly retaining their values.</description>
    <pubDate>Fri, 14 Sep 2001 22:02:06 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2001-09-14T22:02:06Z</dc:date>
    <item>
      <title>DLL Question</title>
      <link>https://community.intel.com/t5/Software-Archive/DLL-Question/m-p/966646#M23043</link>
      <description>Hello, &lt;BR /&gt; &lt;BR /&gt;I am attempting to write a dll that will export one function, but will contain other helper functions that are used for the function I want to export.  I have been able to get this part working.  However I am having trouble with the variables that are contained in a COMMON statement.  My idea is to declare them in the function I want to export, and then add the COMMON line to each of the helper functions that need access to the certain groups.  This compiles as well. &lt;BR /&gt; &lt;BR /&gt; Now from my main export function I call a subroutine that reads a file of data constants and assigns them to the variables in the COMMON block.  I can step through this operation and I can see the variables are being assigned the correct value.  However, when the subroutine exits and returns to the function I want to export the values stored in the variables in the COMMON  are lost, or turned into garbage values.  Can someone please help me determine what the problem is, or if what I am trying to do is even possible &lt;BR /&gt; &lt;BR /&gt;N</description>
      <pubDate>Thu, 13 Sep 2001 22:11:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/DLL-Question/m-p/966646#M23043</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-09-13T22:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: DLL Question</title>
      <link>https://community.intel.com/t5/Software-Archive/DLL-Question/m-p/966647#M23044</link>
      <description>I can't tell immediately what is happening, but here are few tips how to debug it: &lt;BR /&gt; &lt;BR /&gt;1) Switch on "Array &amp;amp; string bounds checking" (somewhere on Project/Settings/Fortran, probably "Run-time" category). Maybe you overwrite neighbouring items in COMMON.&lt;BR /&gt; &lt;BR /&gt;2) Maybe your COMMON members declarations do not match? For example, Implicit integer*2 in one and Implicit integer*4 in another routine can make a nasty mess.&lt;BR /&gt; &lt;BR /&gt;3) If 1) and 2) fail, examine (and write down) in the debugger values of LOC(a), LOC(b), LOC(c)... where a,b,c are first, second,... variable in the same COMMON block in the calling routine and the callee. Normally, these should be identical; if not, you've either an error in 2) or perhaps misspelled COMMON block name or have corrupted stack or... then, please repost (along with some code) &lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Fri, 14 Sep 2001 00:12:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/DLL-Question/m-p/966647#M23044</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-09-14T00:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: DLL Question</title>
      <link>https://community.intel.com/t5/Software-Archive/DLL-Question/m-p/966648#M23045</link>
      <description>I checked option 1 and 2, both check out fine.  When I try 3, I get the same locations for all the variables in the common block &lt;BR /&gt; &lt;BR /&gt;Basically, I am just trying to share the common blocks to the functions in the dll.  Only one such functions is suppose to be accessible, all others are to remain hidden.  The data stored in the Common block is only necessary for the the routines in the dll, so I don't want to import/export data from my main VB executable &lt;BR /&gt; &lt;BR /&gt;The following is an example piece of code that represents what I am tying to do: &lt;BR /&gt; &lt;BR /&gt;DOUBLE PRECISION FUNCTION  OXIDELEVEL(PATH,DATAID,LOC,TIME,TEMP,FLUX) &lt;BR /&gt; &lt;BR /&gt;	!DEC$ ATTRIBUTES DLLEXPORT :: OXIDELEVEL &lt;BR /&gt;	!DEC$ ATTRIBUTES ALIAS:'OXIDELEVEL' :: OXIDELEVEL &lt;BR /&gt;	 &lt;BR /&gt; &lt;BR /&gt;	USE DFIMSL &lt;BR /&gt; &lt;BR /&gt;	IMPLICIT DOUBLE PRECISION(A-H,OZ) &lt;BR /&gt;	 &lt;BR /&gt;	CHARACTER*(*), INTENT(IN) ::  PATH &lt;BR /&gt;	CHARACTER*(*), INTENT(IN) ::  DATAID &lt;BR /&gt;	DOUBLE PRECISION, INTENT(IN) :: LOC &lt;BR /&gt;	DOUBLE PRECISION, INTENT(IN) :: TIME &lt;BR /&gt;	DOUBLE PRECISION, INTENT(IN) :: TEMP &lt;BR /&gt;	DOUBLE PRECISION, INTENT(IN) :: FLUX &lt;BR /&gt;	 &lt;BR /&gt;	DOUBLE PRECISION TEMP2 &lt;BR /&gt;		 &lt;BR /&gt;	COMMON/CONPARAMS/CON1,CON2,CON3,CON4,CON5 &lt;BR /&gt;	COMMON/INITIALSTATES/REC1,LOCS1,REC2,LOCS2 &lt;BR /&gt;	COMMON/WORK/A,B,C,GT,XIT,ERRABS,ERRREL &lt;BR /&gt;COMMON/DATA/XI,OXIDE,DAVG,D95U,D95L &lt;BR /&gt;	DATA ERRABS,ERRREL/1.D-12,1.D-12/ &lt;BR /&gt; &lt;BR /&gt;!CALL INPUT TO READ THE VALUES OF THE CONFIG FILE INTO THE CONPARAMS !AND INITIALSTATES COMMONS &lt;BR /&gt; &lt;BR /&gt;	CALL INPUT(PATH) &lt;BR /&gt; &lt;BR /&gt;	TEMP2 =  CALC(LOC,TIME,TEMP,FLUX) &lt;BR /&gt;END FUNCTION OXIDELEVEL &lt;BR /&gt; &lt;BR /&gt;SUBROUTINE INPUT(PATH) &lt;BR /&gt;	 &lt;BR /&gt;	IMPLICIT DOUBLE PRECISION(A-H,OZ) &lt;BR /&gt; &lt;BR /&gt;	CHARACTER*(*), INTENT(IN) :: PATH &lt;BR /&gt;COMMON/CONPARAMS/CON1,CON2,CON3,CON4,CON5 &lt;BR /&gt;	COMMON/INITIALSTATES/REC1,LOCS1,REC2,LOCS2 &lt;BR /&gt;		 &lt;BR /&gt;	OPEN(FILE=PATH,UNIT=1,STATUS='OLD') &lt;BR /&gt;	 &lt;BR /&gt;	READ(1,*) CON1 &lt;BR /&gt;	READ(1,*) CON2 &lt;BR /&gt;	READ(1,*) CON3 &lt;BR /&gt;	READ(1,*) CON4 &lt;BR /&gt;	READ(1,*) CON5 &lt;BR /&gt; &lt;BR /&gt;	READ(1,*) REC1 &lt;BR /&gt;	READ(1,*) LOCS1 &lt;BR /&gt;	READ(1,*) REC2 &lt;BR /&gt;	READ(1,*) LOCS2 &lt;BR /&gt; &lt;BR /&gt;	CLOSE(UNIT=1) &lt;BR /&gt;	 &lt;BR /&gt;	RETURN &lt;BR /&gt; &lt;BR /&gt;END SUBROUTINE INPUT &lt;BR /&gt; &lt;BR /&gt;DOUBLE PRECISION FUNCTION CALC(LOC,TIME,TEMP,FLUX) &lt;BR /&gt; &lt;BR /&gt;!CONTENTS NOT INCLUDED &lt;BR /&gt;!USES MANY FUNCTIONS IN THE ISML LIBRARY &lt;BR /&gt; &lt;BR /&gt;	COMMON/CONPARAMS/CON1,CON2,CON3,CON4,CON5 &lt;BR /&gt;	COMMON/INITIALSTATES/REC1,LOCS1,REC2,LOCS2 &lt;BR /&gt;COMMON/DATA/XI,OXIDE,DAVG,D95U,D95L &lt;BR /&gt;	 &lt;BR /&gt;END FUNCTION CALC &lt;BR /&gt; &lt;BR /&gt;Thanks for your help, &lt;BR /&gt; &lt;BR /&gt;Nathan</description>
      <pubDate>Fri, 14 Sep 2001 01:54:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/DLL-Question/m-p/966648#M23045</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-09-14T01:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: DLL Question</title>
      <link>https://community.intel.com/t5/Software-Archive/DLL-Question/m-p/966649#M23046</link>
      <description>Thanks for your help guys,  I got it working later that day. I am not sure what I changed, but the COMMON blocks are correctly retaining their values.</description>
      <pubDate>Fri, 14 Sep 2001 22:02:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/DLL-Question/m-p/966649#M23046</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-09-14T22:02:06Z</dc:date>
    </item>
  </channel>
</rss>

