<?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 Unable to update shapefile attributes in c++ in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/unable-to-update-shapefile-attributes-in-c/m-p/578769#M15623</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having trouble updating the attributes in a shapefile using ArcObjects with c++ - nothing seems to get written through to the shapefile, in fact the modify dates of the files are not even updated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I write the equivalent code in a C# application then it works as expected. Similarly, my c++ code works fine with a file geodatabase workspace.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also found that in c++ if I perform the operation without setting up the enclosing edit session then it also works OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas as to what might be going on?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Should I not be using an edit session for shapefiles (even though this does still work in .NET)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Simon Olsberg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IWorkspaceFactoryPtr ipWSF;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipWSF.CreateInstance(CLSID_ShapefileWorkspaceFactory);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IWorkspacePtr ipWorkspace;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipWSF-&amp;gt;OpenFromFile(CComBSTR(shapefileDirectory), 0, &amp;amp;ipWorkspace);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureWorkspacePtr ipFWS(ipWorkspace);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureClassPtr ipFeatureClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipFWS-&amp;gt;OpenFeatureClass(CComBSTR(shapefileName), &amp;amp;ipFeatureClass);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeaturePtr ipFeature;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipFeatureClass-&amp;gt;GetFeature(id, &amp;amp;ipFeature);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IWorkspaceEditPtr workspaceEdit(ipWorkspace);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;workspaceEdit-&amp;gt;StartEditing(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;workspaceEdit-&amp;gt;StartEditOperation();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ipFeature-&amp;gt;put_Value(colIndex, CComVariant(intValue));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipFeature-&amp;gt;Store();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;workspaceEdit-&amp;gt;StopEditOperation();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;workspaceEdit-&amp;gt;StopEditing(true);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jun 2012 15:17:41 GMT</pubDate>
    <dc:creator>SimonOlsberg</dc:creator>
    <dc:date>2012-06-21T15:17:41Z</dc:date>
    <item>
      <title>Unable to update shapefile attributes in c++</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/unable-to-update-shapefile-attributes-in-c/m-p/578769#M15623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having trouble updating the attributes in a shapefile using ArcObjects with c++ - nothing seems to get written through to the shapefile, in fact the modify dates of the files are not even updated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I write the equivalent code in a C# application then it works as expected. Similarly, my c++ code works fine with a file geodatabase workspace.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also found that in c++ if I perform the operation without setting up the enclosing edit session then it also works OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas as to what might be going on?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Should I not be using an edit session for shapefiles (even though this does still work in .NET)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Simon Olsberg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IWorkspaceFactoryPtr ipWSF;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipWSF.CreateInstance(CLSID_ShapefileWorkspaceFactory);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IWorkspacePtr ipWorkspace;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipWSF-&amp;gt;OpenFromFile(CComBSTR(shapefileDirectory), 0, &amp;amp;ipWorkspace);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureWorkspacePtr ipFWS(ipWorkspace);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureClassPtr ipFeatureClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipFWS-&amp;gt;OpenFeatureClass(CComBSTR(shapefileName), &amp;amp;ipFeatureClass);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeaturePtr ipFeature;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipFeatureClass-&amp;gt;GetFeature(id, &amp;amp;ipFeature);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IWorkspaceEditPtr workspaceEdit(ipWorkspace);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;workspaceEdit-&amp;gt;StartEditing(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;workspaceEdit-&amp;gt;StartEditOperation();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ipFeature-&amp;gt;put_Value(colIndex, CComVariant(intValue));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipFeature-&amp;gt;Store();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;workspaceEdit-&amp;gt;StopEditOperation();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;workspaceEdit-&amp;gt;StopEditing(true);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 15:17:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/unable-to-update-shapefile-attributes-in-c/m-p/578769#M15623</guid>
      <dc:creator>SimonOlsberg</dc:creator>
      <dc:date>2012-06-21T15:17:41Z</dc:date>
    </item>
  </channel>
</rss>

