<?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 Using COM Objects with CVF in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-COM-Objects-with-CVF/m-p/843832#M61801</link>
    <description>I have been updating some FORTRAN code that used Automation Objects (an in process server written in VB)- and had significant difficulty access routines using SafeArrays.  &lt;BR /&gt;My first attempts used CVF 6.1 and failed.  I finally attributed that failure to the lack of the INTENT(INOUT) attribute and updated to 6.6.  I still had problems.  The SafeArray of Unsigned Integers was defined as CHARACTER, DIMENSION(:), INTENT(INOUT)with the usual !DEC$ ATTRIBUTES REFERENCE in the function of the module the wizard generated.  I could not get the compiler to even produce code as it complained of type mismatch.&lt;BR /&gt;After consulting some other users of similar ActiveX COM Objects, I convinced the author of this COM Object to make this function return a Variant rather than a SafeArray.  Lo and behold, it worked.  I have never liked imprecise declarations (yes I always use IMPLICIT NONE) - but have concluded (yet again)that you need to let the system do what the designers intended.  Variants seem to let you "get by" with somewhat loose or ill-defined interfaces.&lt;BR /&gt;&lt;BR /&gt;Is this a reasonable conclusion and is there any reason to not use Variants as the preferred type for COM or Automation Work?&lt;BR /&gt;&lt;BR /&gt;Anyone have any samples of accessing COM or Automation Objects from CVF?&lt;BR /&gt;</description>
    <pubDate>Tue, 25 Jun 2002 12:33:23 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2002-06-25T12:33:23Z</dc:date>
    <item>
      <title>Using COM Objects with CVF</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-COM-Objects-with-CVF/m-p/843832#M61801</link>
      <description>I have been updating some FORTRAN code that used Automation Objects (an in process server written in VB)- and had significant difficulty access routines using SafeArrays.  &lt;BR /&gt;My first attempts used CVF 6.1 and failed.  I finally attributed that failure to the lack of the INTENT(INOUT) attribute and updated to 6.6.  I still had problems.  The SafeArray of Unsigned Integers was defined as CHARACTER, DIMENSION(:), INTENT(INOUT)with the usual !DEC$ ATTRIBUTES REFERENCE in the function of the module the wizard generated.  I could not get the compiler to even produce code as it complained of type mismatch.&lt;BR /&gt;After consulting some other users of similar ActiveX COM Objects, I convinced the author of this COM Object to make this function return a Variant rather than a SafeArray.  Lo and behold, it worked.  I have never liked imprecise declarations (yes I always use IMPLICIT NONE) - but have concluded (yet again)that you need to let the system do what the designers intended.  Variants seem to let you "get by" with somewhat loose or ill-defined interfaces.&lt;BR /&gt;&lt;BR /&gt;Is this a reasonable conclusion and is there any reason to not use Variants as the preferred type for COM or Automation Work?&lt;BR /&gt;&lt;BR /&gt;Anyone have any samples of accessing COM or Automation Objects from CVF?&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Jun 2002 12:33:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-COM-Objects-with-CVF/m-p/843832#M61801</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2002-06-25T12:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using COM Objects with CVF</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-COM-Objects-with-CVF/m-p/843833#M61802</link>
      <description>As far as I can remember there are few examples in the CVF samples directory...AdavancedCOM but you presumably gone through that. Maybe a &lt;A href="http://www.compaq.com/fortran/visual/vfn07/index.html"&gt;short arcticle &lt;/A&gt; by Leo Treggiari or his &lt;A href="http://research.compaq.com/wrl/DECarchives/DTJ/DTJP02/DTJP02HM.HTM"&gt; second one &lt;/A&gt; describing Module Wizard with few code samples and explanations can help.&lt;BR /&gt;Moreover, there is nice description in &lt;A href="http://www.compaq.com/fortran/docs/vf-html/pg/pg13srvr.htm"&gt; Docs &lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;SafeArrays and Fortran examples tou can find &lt;A href="http://www.canaimasoft.com/f90VB/Examples/SafeArrayCreateExample.htm"&gt; here &lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Artur</description>
      <pubDate>Tue, 25 Jun 2002 15:57:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-COM-Objects-with-CVF/m-p/843833#M61802</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2002-06-25T15:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using COM Objects with CVF</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-COM-Objects-with-CVF/m-p/843834#M61803</link>
      <description>Thanks, arturguzik, for reminding me of the two articles.&lt;BR /&gt;It's been a while since I had looked at a Digital Technical Journal article, and it aided my understanding of COM.  I believe I had followed the examples correctly, but the compiler thought there was a type mismatch.  It could be that the COM Server I was accessing was poorly written, or didn't have a reasonable interface defined.  Making the parameter in the interface a Variant apparently made passing the data easier. The variant points to a SafeArray and now my code works - I just had to add the line to extract the pointer to the safearray from the variant.  What I was getting at with my question, was that using a variant did make it easier to pass data into my FORTRAN COM client.  I was curious if others had experienced this and what is the computational cost of the varient.  Obviously, I added one de-reference on both the server and the client, but I haven't got enough experience to judge the full repurcussions.  Thanks.</description>
      <pubDate>Thu, 27 Jun 2002 00:07:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-COM-Objects-with-CVF/m-p/843834#M61803</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2002-06-27T00:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using COM Objects with CVF</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-COM-Objects-with-CVF/m-p/843835#M61804</link>
      <description>Dave,&lt;BR /&gt;&lt;BR /&gt;I'm afraid, I can't assist with your Q. However, maybe this&lt;BR /&gt;&lt;A href="http://www.canaimasoft.com/f90VB/Examples/Example65.htm"&gt; example code&lt;/A&gt; will help. As I understand your problem Variants type variable helps you standard way, I mean you do not need to worry about matching types (it's converted into the data type expected by the caller). Maybe, now I speculate, when you extract your data you assume the type incorrectly or it different or changes between calls.&lt;BR /&gt;&lt;BR /&gt;Artur</description>
      <pubDate>Thu, 27 Jun 2002 01:42:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-COM-Objects-with-CVF/m-p/843835#M61804</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2002-06-27T01:42:14Z</dc:date>
    </item>
  </channel>
</rss>

