<?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: OpenFeatureClass throwing an Error: Exception from HRESULT: 0x80040351 in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/openfeatureclass-throwing-an-error-exception-from/m-p/464882#M12607</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;you my have a problem using escape sequences&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"\" is such an escape sequence and will not be interpretet as a string or char&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I dont know how this is soluted in VBA but in c# you have to use "\\" (the first "\" says to use the second one als char)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or you can add an @ before your string&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim filePath As String = "C:\\"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim filePath As String = @"C:\"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim filePath As String = "C:\\temp\\data"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim filePath As String = @"C:\temp\data"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Mar 2011 12:17:35 GMT</pubDate>
    <dc:creator>SebastianKrings</dc:creator>
    <dc:date>2011-03-28T12:17:35Z</dc:date>
    <item>
      <title>OpenFeatureClass throwing an Error: Exception from HRESULT: 0x80040351</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/openfeatureclass-throwing-an-error-exception-from/m-p/464881#M12606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to run one of the examples on adding Dynamic Data. I have the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim filePath As String = "C:\"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim fileName As String = "us_lakes.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; ' Get a reference to the shapefile directory as an ArcObjects FeatureWorkspace&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim workspaceFactory As ESRI.ArcGIS.Geodatabase.IWorkspaceFactory = CType(serverContext.CreateObject("esriDataSourcesFile.ShapefileWorkspaceFactory"), ESRI.ArcGIS.Geodatabase.IWorkspaceFactory)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim workspace As ESRI.ArcGIS.Geodatabase.IWorkspace = workspaceFactory.OpenFromFile(filePath, 0) Dim featureWorkspace As ESRI.ArcGIS.Geodatabase.IFeatureWorkspace = CType(workspace, ESRI.ArcGIS.Geodatabase.IFeatureWorkspace)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; ' Get a reference to the shapefile as a GeoFeatureLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim aoFeatureLayer As ESRI.ArcGIS.Carto.IFeatureLayer = CType(serverContext.CreateObject("esriCarto.FeatureLayer"), ESRI.ArcGIS.Carto.IFeatureLayer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; aoFeatureLayer.FeatureClass = featureWorkspace.OpenFeatureClass(fileName)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am getting an error on the line in red. I know the file exists on the C:\ and it is one of the files supplied by ESRI when installing. I don't know what else I need to do. Please let me know.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lastly, if my filepath is anything other that C:\, like C:\temp\data, the line in blue fails. I don't know why that is either. Please help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2011 15:15:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/openfeatureclass-throwing-an-error-exception-from/m-p/464881#M12606</guid>
      <dc:creator>DaviKucharski</dc:creator>
      <dc:date>2011-03-23T15:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: OpenFeatureClass throwing an Error: Exception from HRESULT: 0x80040351</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/openfeatureclass-throwing-an-error-exception-from/m-p/464882#M12607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;you my have a problem using escape sequences&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"\" is such an escape sequence and will not be interpretet as a string or char&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I dont know how this is soluted in VBA but in c# you have to use "\\" (the first "\" says to use the second one als char)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or you can add an @ before your string&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim filePath As String = "C:\\"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim filePath As String = @"C:\"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim filePath As String = "C:\\temp\\data"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim filePath As String = @"C:\temp\data"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2011 12:17:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/openfeatureclass-throwing-an-error-exception-from/m-p/464882#M12607</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2011-03-28T12:17:35Z</dc:date>
    </item>
  </channel>
</rss>

