<?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: IGPUtilities.DecodeRasterLayer() crashes when 2 layers has same name in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/igputilities-decoderasterlayer-crashes-when-2/m-p/711725#M19025</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It depends on your application but you should be able to pass the data source (full path to raster or raster object) to the GP tool as an alternative to the layer name.&amp;nbsp; More of a workaround than a solution.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Feb 2013 12:19:45 GMT</pubDate>
    <dc:creator>AlexanderGray</dc:creator>
    <dc:date>2013-02-15T12:19:45Z</dc:date>
    <item>
      <title>IGPUtilities.DecodeRasterLayer() crashes when 2 layers has same name</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/igputilities-decoderasterlayer-crashes-when-2/m-p/711724#M19024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got a case here, where two layers has the same name. One of them is a raster layer, the other one is a feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The raster layer is a parameter in a GP tool. When using it as an argument in DecodeRasterLayer(),I get an exception with &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this message: &lt;/SPAN&gt;&lt;STRONG&gt;"HRESULT E_FAIL has been returned from a call to a COM component"&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This happens only if I run the tool as a background process. Otherwise, it works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Before calling DecodeRasterLayer(), I yield the layer data type via AddMessage(). In both cases (background and foreground), &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I get correct datatype (Name = "GPRasterLayer", DisplayName = "Raster Layer").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Its probably not a good practice to have duplicate layer names, but what users do is outside my control..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something that can be done here ? (&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Except loop through the layers and look for duplicate names,&lt;BR /&gt;and then quit the tool with a a message that tells the user to rename the layer..&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Oyvind&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 10:21:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/igputilities-decoderasterlayer-crashes-when-2/m-p/711724#M19024</guid>
      <dc:creator>ØyvindIdland</dc:creator>
      <dc:date>2013-02-15T10:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: IGPUtilities.DecodeRasterLayer() crashes when 2 layers has same name</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/igputilities-decoderasterlayer-crashes-when-2/m-p/711725#M19025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It depends on your application but you should be able to pass the data source (full path to raster or raster object) to the GP tool as an alternative to the layer name.&amp;nbsp; More of a workaround than a solution.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 12:19:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/igputilities-decoderasterlayer-crashes-when-2/m-p/711725#M19025</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2013-02-15T12:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: IGPUtilities.DecodeRasterLayer() crashes when 2 layers has same name</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/igputilities-decoderasterlayer-crashes-when-2/m-p/711726#M19026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It depends on your application but you should be able to pass the data source (full path to raster or raster object) to the GP tool as an alternative to the layer name.&amp;nbsp; More of a workaround than a solution.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yep, that is already an option &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The user can select either a raster layer or a physical file from disk.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added a check for duplicates in UpdateMessages() (in case the param type is a layer), so they have to rename the layer before executing the tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Oyvind&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 13:00:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/igputilities-decoderasterlayer-crashes-when-2/m-p/711726#M19026</guid>
      <dc:creator>ØyvindIdland</dc:creator>
      <dc:date>2013-02-15T13:00:09Z</dc:date>
    </item>
  </channel>
</rss>

