<?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 Every time i close ArcMap (10.3.1) i get the following dialog: &amp;quot;OnShutdown: COM object that has been separated from its underlying RCW cannot be used.&amp;quot; Why? in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/every-time-i-close-arcmap-10-3-1-i-get-the/m-p/751138#M5122</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No matter what .mxd i might be using, I get this message. The program appears to be working fine, except for this odd sounding message. Searching in Google brings up pages of "Stack Overflow" coding-type language that is Greek to me (so to speak). Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Nov 2016 13:39:14 GMT</pubDate>
    <dc:creator>ChaseHowse</dc:creator>
    <dc:date>2016-11-08T13:39:14Z</dc:date>
    <item>
      <title>Every time i close ArcMap (10.3.1) i get the following dialog: "OnShutdown: COM object that has been separated from its underlying RCW cannot be used." Why?</title>
      <link>https://community.esri.com/t5/developers-questions/every-time-i-close-arcmap-10-3-1-i-get-the/m-p/751138#M5122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No matter what .mxd i might be using, I get this message. The program appears to be working fine, except for this odd sounding message. Searching in Google brings up pages of "Stack Overflow" coding-type language that is Greek to me (so to speak). Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2016 13:39:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/every-time-i-close-arcmap-10-3-1-i-get-the/m-p/751138#M5122</guid>
      <dc:creator>ChaseHowse</dc:creator>
      <dc:date>2016-11-08T13:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Every time i close ArcMap (10.3.1) i get the following dialog: "OnShutdown: COM object that has been separated from its underlying RCW cannot be used." Why?</title>
      <link>https://community.esri.com/t5/developers-questions/every-time-i-close-arcmap-10-3-1-i-get-the/m-p/751139#M5123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is nearly impossible to diagnose this without looking at your code. &amp;nbsp;Usually you get this if the COM objects (i.e. arcobjects) do not shutdown in the proper order. &amp;nbsp;And with how .NET does garbage collection you cannot &amp;nbsp;guarantee the order &amp;nbsp;that the COM object will be shut down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A way to circumvent this is to&amp;nbsp;place the following code when you don't need an object any more:&lt;/P&gt;&lt;P&gt;System.Runtime.InteropServices.Marshal.ReleaseComObject(&amp;lt;object&amp;gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I usually put this in a finally block wherever I create and use Cursor objects. &amp;nbsp;Just setting them to null is not enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that there are other objects that use cursors in a hidden manor, like IFeatureClass and any IEnum... classes that could benefit from the ReleaseComObject function. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ESRI has also created a function:&lt;/P&gt;&lt;P&gt;ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown();&lt;/P&gt;&lt;P&gt;which you can put as one of the last statements in your close scripts and it does reasonably well - but not perfect - at preventing this error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brent Hoskisson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2016 16:05:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/every-time-i-close-arcmap-10-3-1-i-get-the/m-p/751139#M5123</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2016-11-10T16:05:03Z</dc:date>
    </item>
  </channel>
</rss>

