<?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 COM problem:  access violation in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/COM-problem-access-violation/m-p/797321#M35925</link>
    <description>Thank-you so much for your reply! Unfortunately,&lt;BR /&gt; 1. I have no idea how to use CoCreateInstance in Fortran, and have been unable to find an example.&lt;BR /&gt; 2. It works perfectly from a .NET application.&lt;BR /&gt;&lt;BR /&gt;Brad.</description>
    <pubDate>Sun, 24 Jun 2012 04:24:06 GMT</pubDate>
    <dc:creator>pletzky</dc:creator>
    <dc:date>2012-06-24T04:24:06Z</dc:date>
    <item>
      <title>COM problem:  access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/COM-problem-access-violation/m-p/797319#M35923</link>
      <description>Whereas I posted this at the end of a different thread, I think it deserves its own posting.&lt;BR /&gt;&lt;BR /&gt;I'm trying to get COM working from my Fortran application. I do a "COMINITIALIZE" followed by a "COMCreateObjectByProgID". Both of these appear to be successful andreturn a status of zero. However, when I try to use the COM object, I get "Unhandled exception at 0x00000000 in FortranProg01.exe: 0xC0000005: Access violation."&lt;BR /&gt;&lt;P&gt;&lt;BR /&gt;I realize that this error can mean almost anything, but has anyone got some suggestions of common problems with COM that produce this problem?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here are some more details. My program code:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;program FortranProg01&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use myolepg&lt;/P&gt;&lt;P&gt;implicit none&lt;/P&gt;&lt;P&gt;integer*4 comInitStatus&lt;/P&gt;&lt;P&gt;integer:: comCreateStatus&lt;/P&gt;&lt;P&gt;INTEGER(INT_PTR_KIND()) $OBJECT&lt;/P&gt;&lt;P&gt;INTEGER(4) funcResult&lt;/P&gt;&lt;P&gt;REAL(8) pkgVersion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call COMINITIALIZE(comInitStatus)&lt;/P&gt;&lt;P&gt;print *, comInitStatus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call COMCreateObjectByProgID('MyOlePg.MyOlePkg', $OBJECT, comCreateStatus)&lt;/P&gt;&lt;P&gt;print *, comCreateStatus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;funcResult = IMyOlePkg_GetPackageVersion($OBJECT, pkgVersion)&lt;/P&gt;&lt;P&gt;print *, funcResult&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call COMUNINITIALIZE()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end program FortranProg01&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The wizard-generated interface code:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;INTERFACE&lt;/P&gt;&lt;P&gt; !property PackageVersion&lt;/P&gt;&lt;P&gt; INTEGER(4) FUNCTION IMyOlePkg_GetPackageVersion($OBJECT, pVal)&lt;/P&gt;&lt;P&gt; INTEGER(INT_PTR_KIND()), INTENT(IN) :: $OBJECT ! Object Pointer&lt;/P&gt;&lt;P&gt; !DEC$ ATTRIBUTES VALUE :: $OBJECT&lt;/P&gt;&lt;P&gt; REAL(8), INTENT(OUT) :: pVal &lt;/P&gt;&lt;P&gt; !DEC$ ATTRIBUTES REFERENCE :: pVal&lt;/P&gt;&lt;P&gt; !DEC$ ATTRIBUTES STDCALL :: IMyOlePkg_GetPackageVersion&lt;/P&gt;&lt;P&gt; END FUNCTION IMyOlePkg_GetPackageVersion&lt;/P&gt;&lt;P&gt;END INTERFACE&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Brad.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2012 17:33:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/COM-problem-access-violation/m-p/797319#M35923</guid>
      <dc:creator>pletzky</dc:creator>
      <dc:date>2012-06-21T17:33:47Z</dc:date>
    </item>
    <item>
      <title>COM problem: Access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/COM-problem-access-violation/m-p/797320#M35924</link>
      <description>1. You could try tocall a 'CoCreateInstance' COM-function instead.&lt;BR /&gt;&lt;BR /&gt;2. Did you try to create an instance of your COM-object with a simple Visual Basic or .NET application?&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Sergey&lt;BR /&gt;</description>
      <pubDate>Sun, 24 Jun 2012 01:48:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/COM-problem-access-violation/m-p/797320#M35924</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2012-06-24T01:48:52Z</dc:date>
    </item>
    <item>
      <title>COM problem:  access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/COM-problem-access-violation/m-p/797321#M35925</link>
      <description>Thank-you so much for your reply! Unfortunately,&lt;BR /&gt; 1. I have no idea how to use CoCreateInstance in Fortran, and have been unable to find an example.&lt;BR /&gt; 2. It works perfectly from a .NET application.&lt;BR /&gt;&lt;BR /&gt;Brad.</description>
      <pubDate>Sun, 24 Jun 2012 04:24:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/COM-problem-access-violation/m-p/797321#M35925</guid>
      <dc:creator>pletzky</dc:creator>
      <dc:date>2012-06-24T04:24:06Z</dc:date>
    </item>
    <item>
      <title>COM problem:  access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/COM-problem-access-violation/m-p/797322#M35926</link>
      <description>OK, it looks like this was a package-specific problem. More accurately, it was my misunderstanding either of the package or of current Fortran conventions. As far as I can tell, pretty much all of the methods in the package are defined twice, once with a regular name and once with a "$" preface. So, if I use the "$IMyOlePkg_GetPackageVersion" call instead of the "IMyOlePkg_GetPackageVersion" call, I get a build warning ("ipo: warning #11077: ...: locally defined symbol ... imported", but it WORKS! (What's particularly interesting is that the "$" method appears simply to add an offset and then call the "non-$" method.)&lt;BR /&gt;&lt;BR /&gt;Now whereas I don't really like the warning, and I'd be happy if someone could explain both the warning and the two different calls, I have it working, and if I never get a satisfactoryexplanation, I can probably learn to live with that.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Brad.</description>
      <pubDate>Sun, 24 Jun 2012 05:20:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/COM-problem-access-violation/m-p/797322#M35926</guid>
      <dc:creator>pletzky</dc:creator>
      <dc:date>2012-06-24T05:20:04Z</dc:date>
    </item>
    <item>
      <title>COM problem: Access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/COM-problem-access-violation/m-p/797323#M35927</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1340667269718="58" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=558488" href="https://community.intel.com/en-us/profile/558488/" class="basic"&gt;pletzky&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;EM&gt;...I get a build warning ("&lt;/EM&gt;&lt;STRONG&gt;ipo: warning #11077: ...: locally defined symbol ... imported&lt;/STRONG&gt;&lt;EM&gt;", but it WORKS! (What's particularly interesting is that the "$" method appears simply to add an offset and then call the "non-$" method.)&lt;BR /&gt;&lt;BR /&gt;Now whereas I don't really like the warning, and I'd be happy if someone could explain both the warning and the two different calls, I have it working, and if I never get a satisfactoryexplanation, I&lt;/EM&gt;&lt;STRONG&gt; can probably learn to live with that&lt;/STRONG&gt;&lt;EM&gt;.&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;Hi Brad,&lt;BR /&gt;This is only a warning and ifapplication works,results/outputs are consistent, I would say, the problem is solved.&lt;BR /&gt;Best regards,&lt;BR /&gt;Sergey&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 Jun 2012 23:37:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/COM-problem-access-violation/m-p/797323#M35927</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2012-06-25T23:37:26Z</dc:date>
    </item>
  </channel>
</rss>

