<?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: can't GetObjectFromFullName with IGxCatalog in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-getobjectfromfullname-with-igxcatalog/m-p/488002#M13162</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I did find an example of testing for a single or an enumeration reference and it turns out the function is returning an enumeration of three references, all to the exact same object, in this case a tif file (also tried a .asc), which I presume is just one object. And this is probably why my code worked on a different build; it was always only returning a single reference. So, why am I getting three now?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Aug 2011 17:08:07 GMT</pubDate>
    <dc:creator>EvanThoms</dc:creator>
    <dc:date>2011-08-01T17:08:07Z</dc:date>
    <item>
      <title>can't GetObjectFromFullName with IGxCatalog</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-getobjectfromfullname-with-igxcatalog/m-p/487999#M13159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In an ArcMap addin I have the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Dim gxCat As IGxCatalog
Dim pObj As IGxObject
Dim x As Long

gxCat = New GxCatalogClass

pObj = pObj = gxCat.GetObjectFromFullName(sPath, x)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But the last line trips the error - Cannot convert to 'Interface IGxObject', but that's exactly what the function is documented to do. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know the path is good (tried a few) and I think I am getting a valid catalog object, I mean, I can do things with it like make a folder connection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Furthermore, on my previous computer, this same addin and this same chunk of code never threw an error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, what I am trying to do is, from a full path to an object, determine first if the path leads to a valid ArcCatalog object and then what the datase type of that object is, so if there is another way beside getting to IGxDataset.Dataset.Type I would appreciate it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 22:05:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-getobjectfromfullname-with-igxcatalog/m-p/487999#M13159</guid>
      <dc:creator>EvanThoms</dc:creator>
      <dc:date>2011-07-28T22:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: can't GetObjectFromFullName with IGxCatalog</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-getobjectfromfullname-with-igxcatalog/m-p/488000#M13160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This line is incorrect:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pObj = pObj = gxCat.GetObjectFromFullName(sPath, x)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It should be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pObj = gxCat.GetObjectFromFullName(sPath, x)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, GetObjectFromFullName may return an IGxObject reference or an IEnumGxObject reference.&amp;nbsp; Your code should handle the possibility of both.&amp;nbsp; See the developer help for more info and for an example.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 12:07:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-getobjectfromfullname-with-igxcatalog/m-p/488000#M13160</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-07-29T12:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: can't GetObjectFromFullName with IGxCatalog</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-getobjectfromfullname-with-igxcatalog/m-p/488001#M13161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can refer following VBA example to implement the functionality.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you can try to get full name from GetObjectFullName into a variant type of variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sub GetObjFromFullname()&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim pApp As IGxApplication&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Set pApp = Application&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim pCat As IGxCatalog &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Set pCat = pApp.Catalog &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Dim pGxObject As IGxObject&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim numFound As Long&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim v As Variant&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Set v = pCat.GetObjectFromFullName("C:\data\parcels.shp", numFound)&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Assuming the above pathname is valid &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; If numFound = 1 Then&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Set pGxObject = v&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Else&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pEnumGxObject As IEnumGxObject &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pEnumGxObject = v&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Set pGxObject = pEnumGxObject.Next &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this helps!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 18:02:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-getobjectfromfullname-with-igxcatalog/m-p/488001#M13161</guid>
      <dc:creator>amrutabildikar1</dc:creator>
      <dc:date>2011-07-29T18:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: can't GetObjectFromFullName with IGxCatalog</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-getobjectfromfullname-with-igxcatalog/m-p/488002#M13162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I did find an example of testing for a single or an enumeration reference and it turns out the function is returning an enumeration of three references, all to the exact same object, in this case a tif file (also tried a .asc), which I presume is just one object. And this is probably why my code worked on a different build; it was always only returning a single reference. So, why am I getting three now?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 17:08:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-getobjectfromfullname-with-igxcatalog/m-p/488002#M13162</guid>
      <dc:creator>EvanThoms</dc:creator>
      <dc:date>2011-08-01T17:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: can't GetObjectFromFullName with IGxCatalog</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-getobjectfromfullname-with-igxcatalog/m-p/488003#M13163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;And another weird thing is happening I didn't at first think was related. When&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pObj = gxCat.GetObjectFromFullName(sPath, numFound)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;is called, an unnamed .prj file appears in the folder alongside the mxd that has the addin with the spatial reference of the tif file at the end of sPath.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2011 20:24:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/can-t-getobjectfromfullname-with-igxcatalog/m-p/488003#M13163</guid>
      <dc:creator>EvanThoms</dc:creator>
      <dc:date>2011-08-01T20:24:24Z</dc:date>
    </item>
  </channel>
</rss>

