<?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: Getting error &amp;quot;COM object that has been separated from its underlying RC in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-error-amp-quot-com-object-that-has-been/m-p/420055#M11296</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unfortunately, I'm working and calling everything from the main thread so this wouldn't be the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The layer variable I am referencing is a global though.... the method that is causing trouble is called from inside an the active view's onselectionchanged event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Oct 2011 01:17:12 GMT</pubDate>
    <dc:creator>MichaelRutkowski</dc:creator>
    <dc:date>2011-10-13T01:17:12Z</dc:date>
    <item>
      <title>Getting error &amp;quot;COM object that has been separated from its underlying RC</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-error-amp-quot-com-object-that-has-been/m-p/420053#M11294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having a particularly odd issue occurring. I created a custom component using both the addin model and custom COM dll.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I use the tool under one login (administrative privileges), I have no issues. The other login crashes at the oddest spot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It crashes when I try to obtain a feature using the getfeature method from a featureclass. The error actually seems to occur as the result of obtaining the featureclass from the layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if not pLayer is nothing then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if not pLayer.FeatureClass is nothing then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'error occurs here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeat = pLayer.FeatureClass.GetFeature(id)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; end if&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;end if&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When it crashes, I get the following error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error: CopyPasteTool **COM object that has been separated from its underlying RCW cannot be used.** at CopyPasteTool.bas_LoadDataTools.ListSelectedFeatures() select item in list (list items are not updated after first selection) ESRI.arcgis.Carto COM object that has been separated from its underlying RCW cannot be used. at ESRI.arcGIS.Carto.IFeatureLayer.Get_FeatureClass() at CopypasteTool.CopyPasteDocWin.list_FeatureSelection_SelectedIndexChanged(object sender, EventArgs e) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The key element of this error is of course:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"COM object that has been separated from its underlying RCW cannot be use"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This error occurs when I try to get the featureclass from a layer. The layer object is NOT null, and obtaining the featureclass elsewhere doesn't seem to cause a problem. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone else run into this error? Any strategies for resolving it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 00:52:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/getting-error-amp-quot-com-object-that-has-been/m-p/420053#M11294</guid>
      <dc:creator>MichaelRutkowski</dc:creator>
      <dc:date>2011-10-12T00:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error "COM object that has been separated from its underlying RC</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-error-amp-quot-com-object-that-has-been/m-p/420054#M11295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://forums.arcgis.com/threads/2534-COM-object-that-has-been-separated-from-its-underlying-RCW-cannot-be-used?p=18153#post18153"&gt;http://forums.arcgis.com/threads/2534-COM-object-that-has-been-separated-from-its-underlying-RCW-cannot-be-used?p=18153#post18153&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 00:46:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/getting-error-amp-quot-com-object-that-has-been/m-p/420054#M11295</guid>
      <dc:creator>RichardWatson</dc:creator>
      <dc:date>2011-10-13T00:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error "COM object that has been separated from its underlying RC</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-error-amp-quot-com-object-that-has-been/m-p/420055#M11296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unfortunately, I'm working and calling everything from the main thread so this wouldn't be the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The layer variable I am referencing is a global though.... the method that is causing trouble is called from inside an the active view's onselectionchanged event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 01:17:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/getting-error-amp-quot-com-object-that-has-been/m-p/420055#M11296</guid>
      <dc:creator>MichaelRutkowski</dc:creator>
      <dc:date>2011-10-13T01:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error "COM object that has been separated from its underlying RC</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-error-amp-quot-com-object-that-has-been/m-p/420056#M11297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I assume that this is not occurring during ArcMap shutdown.&amp;nbsp; If it is then you need to explicitly say so.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you refetch/rediscover the layer you need?&amp;nbsp; Perhaps the layer you had is no longer valid?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another possibility is that the object you are using is not valid because someone has called, correctly or incorrectly, a function which which destroys the underlying COM object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can debug this but doing so is going to be rather advanced.&amp;nbsp; I think that you would want to set a breakpoint on the functions that are called to do this.&amp;nbsp; There are several of this functions such as Marshal.ReleaseComObject, Marshal.FinalReleaseComObject, etc.&amp;nbsp; If you don't know how to do this then just ignore this comment.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 10:40:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/getting-error-amp-quot-com-object-that-has-been/m-p/420056#M11297</guid>
      <dc:creator>RichardWatson</dc:creator>
      <dc:date>2011-10-13T10:40:28Z</dc:date>
    </item>
  </channel>
</rss>

