<?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 Problem While returning an array from CVF COM dll to ASP page.... in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Problem-While-returning-an-array-from-CVF-COM-dll-to-ASP-page/m-p/959838#M21559</link>
    <description>Hi friends, &lt;BR /&gt;I have written a COM component in Fortran.I am getting an error message while I am calling one of the function of that component in my ASP page.The error message I am getting is &lt;BR /&gt; &lt;BR /&gt;Error Type: &lt;BR /&gt;Microsoft VBScript runtime (0x800A000D) &lt;BR /&gt;Type mismatch: 'xx' &lt;BR /&gt;/fortran/chk.asp, line 11 &lt;BR /&gt; &lt;BR /&gt;I am attaching both my fortran code and asp code for better understanding of the problem. &lt;BR /&gt; &lt;BR /&gt;Fortran Code &lt;BR /&gt;&lt;FONT size="+0"&gt;&lt;PRE&gt;
************* 
! 
!  UItestclass.f90 - This file contains the implementation of the 
!                    Itestclass methods 
! 
    ! Itestclass_xx 
    function Itestclass_xx( ObjectData ,&amp;amp; 
			 y,&amp;amp; 
			 x) result (hresult) 
        use testclass_Types 
		use dfwinty 
		use oleaut32 
        implicit none 
        type(testclass_InstanceData) ObjectData 
        !dec$ attributes reference :: ObjectData 
        TYPE(VARIANT), intent(inout) :: y 
        DIMENSION y(0:2) 
        integer(4), intent(in) :: x 
        integer(LONG) hresult 
        ! TODO:  Add implementation 
 
		call VariantInit(y(0)) 
		y(0)%vt = VT_R8 
		y(0)%vu%DOUBLE_VAL =1.8  
		call VariantInit(y(1)) 
		y(1)%vt = VT_R8 
		y(1)%vu%DOUBLE_VAL =2.6 
		call VariantInit(y(2)) 
		y(2)%vt = VT_R8 
		y(2)%vu%DOUBLE_VAL =3.6 * x 
		 
		 
        hresult = S_OK 
    end function 
 
ASP code 
*********** 
&lt;L&gt;")
Response.Write(y(1) &amp;amp; "&lt;BR /&gt;") 
Response.Write(y(2) &amp;amp; "&lt;BR /&gt;") 
%&amp;gt; 
&lt;/L&gt;&lt;/PRE&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;In my fortran code while I am removing the input input parameter,I am able to get the array value in the asp page. &lt;BR /&gt; &lt;BR /&gt;I will be glad if I will get any suggestion to solve the problem. &lt;BR /&gt; &lt;BR /&gt;Thanks &lt;BR /&gt;&lt;BR /&gt;Debaprasad Tripathy &lt;BR /&gt;&lt;BR /&gt;Timken Engg. And Research India Pvt. Ltd.</description>
    <pubDate>Tue, 24 Jul 2001 16:31:10 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2001-07-24T16:31:10Z</dc:date>
    <item>
      <title>Problem While returning an array from CVF COM dll to ASP page....</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-While-returning-an-array-from-CVF-COM-dll-to-ASP-page/m-p/959838#M21559</link>
      <description>Hi friends, &lt;BR /&gt;I have written a COM component in Fortran.I am getting an error message while I am calling one of the function of that component in my ASP page.The error message I am getting is &lt;BR /&gt; &lt;BR /&gt;Error Type: &lt;BR /&gt;Microsoft VBScript runtime (0x800A000D) &lt;BR /&gt;Type mismatch: 'xx' &lt;BR /&gt;/fortran/chk.asp, line 11 &lt;BR /&gt; &lt;BR /&gt;I am attaching both my fortran code and asp code for better understanding of the problem. &lt;BR /&gt; &lt;BR /&gt;Fortran Code &lt;BR /&gt;&lt;FONT size="+0"&gt;&lt;PRE&gt;
************* 
! 
!  UItestclass.f90 - This file contains the implementation of the 
!                    Itestclass methods 
! 
    ! Itestclass_xx 
    function Itestclass_xx( ObjectData ,&amp;amp; 
			 y,&amp;amp; 
			 x) result (hresult) 
        use testclass_Types 
		use dfwinty 
		use oleaut32 
        implicit none 
        type(testclass_InstanceData) ObjectData 
        !dec$ attributes reference :: ObjectData 
        TYPE(VARIANT), intent(inout) :: y 
        DIMENSION y(0:2) 
        integer(4), intent(in) :: x 
        integer(LONG) hresult 
        ! TODO:  Add implementation 
 
		call VariantInit(y(0)) 
		y(0)%vt = VT_R8 
		y(0)%vu%DOUBLE_VAL =1.8  
		call VariantInit(y(1)) 
		y(1)%vt = VT_R8 
		y(1)%vu%DOUBLE_VAL =2.6 
		call VariantInit(y(2)) 
		y(2)%vt = VT_R8 
		y(2)%vu%DOUBLE_VAL =3.6 * x 
		 
		 
        hresult = S_OK 
    end function 
 
ASP code 
*********** 
&lt;L&gt;")
Response.Write(y(1) &amp;amp; "&lt;BR /&gt;") 
Response.Write(y(2) &amp;amp; "&lt;BR /&gt;") 
%&amp;gt; 
&lt;/L&gt;&lt;/PRE&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;In my fortran code while I am removing the input input parameter,I am able to get the array value in the asp page. &lt;BR /&gt; &lt;BR /&gt;I will be glad if I will get any suggestion to solve the problem. &lt;BR /&gt; &lt;BR /&gt;Thanks &lt;BR /&gt;&lt;BR /&gt;Debaprasad Tripathy &lt;BR /&gt;&lt;BR /&gt;Timken Engg. And Research India Pvt. Ltd.</description>
      <pubDate>Tue, 24 Jul 2001 16:31:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-While-returning-an-array-from-CVF-COM-dll-to-ASP-page/m-p/959838#M21559</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-07-24T16:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem While returning an array from CVF COM dll to ASP pa</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-While-returning-an-array-from-CVF-COM-dll-to-ASP-page/m-p/959839#M21560</link>
      <description>Hi, &lt;BR /&gt; &lt;BR /&gt;The problem is that scripting clients send arrays as a Variant containing a Safearray of Variants.  In your code, the interface method is expecting just a SafeArray of Variants.  That is your type mismatch. &lt;BR /&gt; &lt;BR /&gt;Once you straighten that out, you'll have to do the fun defensive coding dealing with variant args.  Like whether or not the variant was passed with VT_BYREF which affects getting access to the safeArray pointer in the variant.  And like whether or not the variant elements of the safearray really are of the type you're expecting.  And what method will you use to access the SafeArray of variants in Fortran. &lt;BR /&gt; &lt;BR /&gt;IMO, writing COM code for scripting clients is a pain in the neck, independent of the programming language.  FWIW, this gets better in .NET. &lt;BR /&gt; &lt;BR /&gt;hth, &lt;BR /&gt;John</description>
      <pubDate>Mon, 30 Jul 2001 15:08:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-While-returning-an-array-from-CVF-COM-dll-to-ASP-page/m-p/959839#M21560</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-07-30T15:08:49Z</dc:date>
    </item>
  </channel>
</rss>

