<?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 File Handling in COM server..... in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961026#M21815</link>
    <description>Hi Friends, &lt;BR /&gt;               I have written a function in my COM server component which accepts the name  of a file as an input string.Inside the function I am generating 20 random numbers and storing those numbers  into a data file and sending the average of those numbers to the client.Here I am able to build the dll but while I am calling this function either in VB or in ASP it is not responding. &lt;BR /&gt;I am attaching the code below. I will be glad if I will get any suggestion from anybody. &lt;BR /&gt;Thanks in Advance  &lt;BR /&gt;Debaprasad Tripathy &lt;BR /&gt;tripathd@timken.com &lt;BR /&gt; &lt;BR /&gt;Fortran Code &lt;BR /&gt;***************** &lt;BR /&gt; &lt;BR /&gt;    function IFileCOMServerClass_CallFile( ObjectData ,&amp;amp; &lt;BR /&gt;             FileName,&amp;amp; &lt;BR /&gt;            Avg) result (hresult) &lt;BR /&gt;        use FileCOMServerClass_Types &lt;BR /&gt;        use oleaut32 &lt;BR /&gt;        use dfwinty &lt;BR /&gt;        implicit none &lt;BR /&gt;        type(FileCOMServerClass_InstanceData) ObjectData &lt;BR /&gt;        !dec$ attributes reference :: ObjectData &lt;BR /&gt;        CHARACTER(*), intent(in) :: FileName &lt;BR /&gt;        TYPE(VARIANT), intent(inout) :: Avg &lt;BR /&gt;        integer(LONG) hresult &lt;BR /&gt;        ! TODO:  Add implementation &lt;BR /&gt;		REAL x, total,value &lt;BR /&gt;		INTEGER count,I &lt;BR /&gt;		OPEN (1, FILE = FileName) &lt;BR /&gt;		DO I = 1, 20 &lt;BR /&gt;		CALL RANDOM_NUMBER(x) &lt;BR /&gt;		WRITE (1, '(F6.3)') x * 100.0 &lt;BR /&gt;		END DO &lt;BR /&gt;		CLOSE(1) &lt;BR /&gt;		OPEN (1, FILE = FileName) &lt;BR /&gt;		DO WHILE (.NOT. EOF(1)) &lt;BR /&gt;		count = count + 1 &lt;BR /&gt;		READ (1, *) value &lt;BR /&gt;		total = total + value &lt;BR /&gt;		END DO &lt;BR /&gt;100		IF ( count .GT. 0) THEN &lt;BR /&gt;		call VariantInit(Avg) &lt;BR /&gt;		Avg%vt = VT_R8 &lt;BR /&gt;		Avg%vu%DOUBLE_VAL=total/count &lt;BR /&gt;		END IF &lt;BR /&gt;		STOP &lt;BR /&gt;        hresult = S_OK &lt;BR /&gt;    end function</description>
    <pubDate>Wed, 01 Aug 2001 17:45:15 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2001-08-01T17:45:15Z</dc:date>
    <item>
      <title>File Handling in COM server.....</title>
      <link>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961026#M21815</link>
      <description>Hi Friends, &lt;BR /&gt;               I have written a function in my COM server component which accepts the name  of a file as an input string.Inside the function I am generating 20 random numbers and storing those numbers  into a data file and sending the average of those numbers to the client.Here I am able to build the dll but while I am calling this function either in VB or in ASP it is not responding. &lt;BR /&gt;I am attaching the code below. I will be glad if I will get any suggestion from anybody. &lt;BR /&gt;Thanks in Advance  &lt;BR /&gt;Debaprasad Tripathy &lt;BR /&gt;tripathd@timken.com &lt;BR /&gt; &lt;BR /&gt;Fortran Code &lt;BR /&gt;***************** &lt;BR /&gt; &lt;BR /&gt;    function IFileCOMServerClass_CallFile( ObjectData ,&amp;amp; &lt;BR /&gt;             FileName,&amp;amp; &lt;BR /&gt;            Avg) result (hresult) &lt;BR /&gt;        use FileCOMServerClass_Types &lt;BR /&gt;        use oleaut32 &lt;BR /&gt;        use dfwinty &lt;BR /&gt;        implicit none &lt;BR /&gt;        type(FileCOMServerClass_InstanceData) ObjectData &lt;BR /&gt;        !dec$ attributes reference :: ObjectData &lt;BR /&gt;        CHARACTER(*), intent(in) :: FileName &lt;BR /&gt;        TYPE(VARIANT), intent(inout) :: Avg &lt;BR /&gt;        integer(LONG) hresult &lt;BR /&gt;        ! TODO:  Add implementation &lt;BR /&gt;		REAL x, total,value &lt;BR /&gt;		INTEGER count,I &lt;BR /&gt;		OPEN (1, FILE = FileName) &lt;BR /&gt;		DO I = 1, 20 &lt;BR /&gt;		CALL RANDOM_NUMBER(x) &lt;BR /&gt;		WRITE (1, '(F6.3)') x * 100.0 &lt;BR /&gt;		END DO &lt;BR /&gt;		CLOSE(1) &lt;BR /&gt;		OPEN (1, FILE = FileName) &lt;BR /&gt;		DO WHILE (.NOT. EOF(1)) &lt;BR /&gt;		count = count + 1 &lt;BR /&gt;		READ (1, *) value &lt;BR /&gt;		total = total + value &lt;BR /&gt;		END DO &lt;BR /&gt;100		IF ( count .GT. 0) THEN &lt;BR /&gt;		call VariantInit(Avg) &lt;BR /&gt;		Avg%vt = VT_R8 &lt;BR /&gt;		Avg%vu%DOUBLE_VAL=total/count &lt;BR /&gt;		END IF &lt;BR /&gt;		STOP &lt;BR /&gt;        hresult = S_OK &lt;BR /&gt;    end function</description>
      <pubDate>Wed, 01 Aug 2001 17:45:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961026#M21815</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-01T17:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: File Handling in COM server.....</title>
      <link>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961027#M21816</link>
      <description>Remove the STOP statement in your code and it will work.  &lt;BR /&gt;In general, STOP statements don't belong in DLLs or COM servers. &lt;BR /&gt; &lt;BR /&gt;hth, &lt;BR /&gt;John</description>
      <pubDate>Wed, 01 Aug 2001 21:01:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961027#M21816</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-01T21:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: File Handling in COM server.....</title>
      <link>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961028#M21817</link>
      <description>hi john, &lt;BR /&gt;it is working great in ASP page after removing STOP from the code.I have a small doubt.By default it creates the data file in c:winntsystem32 .Is it possible to give a particular folder name in the OPEN st. &lt;BR /&gt;Thanks, &lt;BR /&gt;Debaprasad Tripathy</description>
      <pubDate>Wed, 01 Aug 2001 21:22:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961028#M21817</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-01T21:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: File Handling in COM server.....</title>
      <link>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961029#M21818</link>
      <description>Sure, have the caller specify the full path to the file.</description>
      <pubDate>Wed, 01 Aug 2001 21:46:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961029#M21818</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-01T21:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: File Handling in COM server.....</title>
      <link>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961030#M21819</link>
      <description>I don't know exactly what's the intention of the code, however, note that writing to WinntSystem32 is a) "impolite" b) if the disk is NTFS and system well configured, you probably won't even be able to write there without Administrator privileges. Consider writing to temp directory (GetTempPath).</description>
      <pubDate>Wed, 01 Aug 2001 22:41:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961030#M21819</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-08-01T22:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: File Handling in COM server.....</title>
      <link>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961031#M21820</link>
      <description>Hi Jugoslav, &lt;BR /&gt; &lt;BR /&gt;This was my thinking of how the file got to system32:&lt;BR /&gt; &lt;BR /&gt;if the caller doesn't include the full path to the file, then the file is opened in the current directory.  If the COM object is called by an ASP page, then the calling app is IIS and system32 is the apps current dir.  &lt;BR /&gt; &lt;BR /&gt;In any case, the ASP script should use a full path in the call. &lt;BR /&gt; &lt;BR /&gt;-John</description>
      <pubDate>Wed, 01 Aug 2001 23:58:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/File-Handling-in-COM-server/m-p/961031#M21820</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-01T23:58:12Z</dc:date>
    </item>
  </channel>
</rss>

