<?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: Access Violation in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Access-Violation/m-p/938023#M16320</link>
    <description>After the f90 call to LoadLibrary, how are you making calls to the C++ code?  What routines are being called by f90 caller?  What C++ routines are exported from the dll?  Are they class instance methods (or perhaps did you export the &lt;I&gt;class&lt;/I&gt;)?  How is an object of your class instantiated?  (who does it?) &lt;BR /&gt; &lt;BR /&gt;Your comments that things work with a C++ caller but not a f90 caller make me wonder if you're trying to call class methods, which would work in C++ but the f90 code probably doesn't have the this pointer. &lt;BR /&gt; &lt;BR /&gt;hth, &lt;BR /&gt;John</description>
    <pubDate>Sat, 10 Feb 2001 03:35:09 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2001-02-10T03:35:09Z</dc:date>
    <item>
      <title>Access Violation</title>
      <link>https://community.intel.com/t5/Software-Archive/Access-Violation/m-p/938022#M16319</link>
      <description>I have C++ DLL that is called by a Fortran application using LoadLibrary and &lt;BR /&gt;releasing using FreeLibrary.  The DLL performs large amounts of SQL inserts &lt;BR /&gt;using &lt;BR /&gt;OLEDB.  I override the the default initInstance of the DLL with the &lt;BR /&gt;following: &lt;BR /&gt; &lt;BR /&gt;BOOL CProsym_sqlApp::InitInstance() &lt;BR /&gt;{ &lt;BR /&gt;file://Create the database conection &lt;BR /&gt;if (CreateDBConn()&amp;lt;0) return FALSE; &lt;BR /&gt;return true; &lt;BR /&gt;// return CWinApp::InitInstance(); &lt;BR /&gt;} &lt;BR /&gt; &lt;BR /&gt;and also I override the default ExitInstance of the DLL with the following: &lt;BR /&gt; &lt;BR /&gt;BOOL CProsym_sqlApp::ExitInstance() &lt;BR /&gt;{ &lt;BR /&gt;file://Cleanup OLEDB Session &lt;BR /&gt;if (CloseOLEDBSession()&amp;lt;0) return FALSE; &lt;BR /&gt;return true; &lt;BR /&gt;// return CWinApp::ExitInstance(); &lt;BR /&gt;} &lt;BR /&gt; &lt;BR /&gt;where &lt;BR /&gt; &lt;BR /&gt;file://Close OLEDB Session &lt;BR /&gt;int CloseOLEDBSession() &lt;BR /&gt;{ &lt;BR /&gt;try &lt;BR /&gt;{ &lt;BR /&gt;session.Close();  // close session &lt;BR /&gt;ds.Close(); &lt;BR /&gt;} &lt;BR /&gt;catch (...) &lt;BR /&gt;{ &lt;BR /&gt;return ERR_DB_CLOSE_OLEDB_SESSION; &lt;BR /&gt;} &lt;BR /&gt;return TRUE; &lt;BR /&gt;} &lt;BR /&gt; &lt;BR /&gt;I am finding that the FORTRAN application is exiting with an ACCESS &lt;BR /&gt;VIOLATION &lt;BR /&gt;when the DLL tries to execute the CloseOLEDBSession.  Specifically, when I &lt;BR /&gt;step &lt;BR /&gt;through the code and I session.Close() I am taken to the following: &lt;BR /&gt; &lt;BR /&gt;file://Close the session  in ATLDBCLI.H &lt;BR /&gt;void Close() &lt;BR /&gt;{ &lt;BR /&gt;   m_spOpenRowSet.Release(); &lt;BR /&gt;} &lt;BR /&gt; &lt;BR /&gt;which takes me to the following in ATLBASE.H &lt;BR /&gt;void Release() &lt;BR /&gt;{ &lt;BR /&gt;   IUnknown* pTemp = p; &lt;BR /&gt;   if (pTemp) &lt;BR /&gt;   { &lt;BR /&gt;      p = NULL; &lt;BR /&gt;      pTemp-&amp;gt;Release();   &amp;lt;---this line causes the access Violation &lt;BR /&gt;   } &lt;BR /&gt; &lt;BR /&gt;I am pretty sure that the problem is related to Fortran because when I build a simple C++ console application to call the DLL, things work fine.  It is only when the Fortran application calls the DLL that I get this access violation error. &lt;BR /&gt; &lt;BR /&gt;Any suggestions on how to eliminate the Access Violation and successfully close the connection to SQL? &lt;BR /&gt; &lt;BR /&gt;Tom</description>
      <pubDate>Thu, 08 Feb 2001 06:47:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Access-Violation/m-p/938022#M16319</guid>
      <dc:creator>tschicker</dc:creator>
      <dc:date>2001-02-08T06:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Access Violation</title>
      <link>https://community.intel.com/t5/Software-Archive/Access-Violation/m-p/938023#M16320</link>
      <description>After the f90 call to LoadLibrary, how are you making calls to the C++ code?  What routines are being called by f90 caller?  What C++ routines are exported from the dll?  Are they class instance methods (or perhaps did you export the &lt;I&gt;class&lt;/I&gt;)?  How is an object of your class instantiated?  (who does it?) &lt;BR /&gt; &lt;BR /&gt;Your comments that things work with a C++ caller but not a f90 caller make me wonder if you're trying to call class methods, which would work in C++ but the f90 code probably doesn't have the this pointer. &lt;BR /&gt; &lt;BR /&gt;hth, &lt;BR /&gt;John</description>
      <pubDate>Sat, 10 Feb 2001 03:35:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Access-Violation/m-p/938023#M16320</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-02-10T03:35:09Z</dc:date>
    </item>
  </channel>
</rss>

