<?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 Error caused byIEditor.AbortOperation called at IEditorEvents.OnCreateFeature handler in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/error-caused-byieditor-abortoperation-called-at/m-p/351510#M9263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everybody:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I wrote some C# code like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
IEditor m_editor = ...
IFeatureClass featCls = ...

(m_editor as IEditorEvents_Events).OnCreateFeature = ... // the handler calls m_editor.AbortOperation in some situation
m_editor.StartOperation();
IFeature feat = featCls.CreateFeature();
// modify feat
feat.Store();
m_editor.StopOperation("Create Feature");

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the code is execute, the IEditorEvents.OnCreateFeature event handler is triggered when feat.Store() is run. In the event handler if m_editor.AbortOperation is call in some situation to abort the feature creation. However, I got exception:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;**************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Geodatabase.IFeature.Store()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;**************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why does this happen? How can I let the event handler abort the operation?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Nov 2013 05:40:44 GMT</pubDate>
    <dc:creator>SuiHuang</dc:creator>
    <dc:date>2013-11-06T05:40:44Z</dc:date>
    <item>
      <title>Error caused byIEditor.AbortOperation called at IEditorEvents.OnCreateFeature handler</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/error-caused-byieditor-abortoperation-called-at/m-p/351510#M9263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everybody:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I wrote some C# code like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
IEditor m_editor = ...
IFeatureClass featCls = ...

(m_editor as IEditorEvents_Events).OnCreateFeature = ... // the handler calls m_editor.AbortOperation in some situation
m_editor.StartOperation();
IFeature feat = featCls.CreateFeature();
// modify feat
feat.Store();
m_editor.StopOperation("Create Feature");

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the code is execute, the IEditorEvents.OnCreateFeature event handler is triggered when feat.Store() is run. In the event handler if m_editor.AbortOperation is call in some situation to abort the feature creation. However, I got exception:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;**************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Geodatabase.IFeature.Store()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;**************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why does this happen? How can I let the event handler abort the operation?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 05:40:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/error-caused-byieditor-abortoperation-called-at/m-p/351510#M9263</guid>
      <dc:creator>SuiHuang</dc:creator>
      <dc:date>2013-11-06T05:40:44Z</dc:date>
    </item>
  </channel>
</rss>

